Visual multi-task mounted agricultural inspection method and device based on deep learning
Through the visual multi-task mounted agricultural inspection method based on deep learning, multi-camera and semantic classification models are used to achieve 360° surround view and multi-task functions of agricultural scenes, solving the environmental adaptability and cost control problems of traditional technology. It improves the efficiency and accuracy of agricultural inspections.
Patent Information
- Application Number
- CN202410589220.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-05-13
AI Technical Summary
Existing agricultural inspection technology has deficiencies in environmental adaptability and cost control. Especially under the constraints of terrain and environmental factors in hilly areas, traditional mechanization and intelligent solutions are difficult to balance cost control and scene adaptability, and lack of The inspection function of agricultural facilities and pipelines results in high maintenance costs and data quality is affected by the environment.
A visual multi-task mounted agricultural inspection method based on deep learning is adopted. Multiple cameras are set up in a circle around the height of the agricultural machinery to form a 360° surround view. The multi-task target detection and semantic classification model are combined to realize the inspection of crops and facilities. Identification and environment segmentation, positioning, crop protection and facility inspection, using semantic target association and fusion positioning to perform crop or facility maintenance tasks.
It achieves environmental adaptability and multi-task functions in agricultural scenarios while controlling costs, reduces maintenance costs, improves data quality and operating efficiency, and can effectively identify crop pests, lodging, facility damage and equipment status, improving Improve the operation and maintenance efficiency of agricultural systems.
Smart Images

Figure CN118447320B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of imaging technology, and in particular to a visual multi-task mounted agricultural inspection method and device based on deep learning. Background Art
[0002] The development and promotion of modern agricultural technology is subject to the consideration of input costs and returns. In the vast plain crop production areas, large-scale, mechanized environmental agriculture has a high degree of automation. In hilly areas, however, due to the limitations of terrain and environmental factors, small semi-automated machinery and manual labor are used as the main operation methods.
[0003] Generally speaking, the current agricultural development in my country continues to maintain the coverage of mechanized automation operations, and has also begun to explore the direction of intelligence, such as fixed infrastructure investment such as fixed-point pest monitoring, intelligent water-saving irrigation systems, mobile agricultural machinery such as automated sowing and harvesting, drone-based plant protection and other subsystems for specific applications. However, it is difficult to achieve a solution that not only meets the needs of improving the productivity of plant protection and mobile agricultural machinery vehicles, but also takes into account the inspection and maintenance functions of fixed infrastructure, and at the same time can do a good job of cost control and scene adaptability.
[0004] Among the currently disclosed related technologies, such as the intelligent inspection and harvesting technology for facility agriculture and the intelligent greenhouse inspection technology based on AI, each proposed a device based on wheeled or rail-type chassis control and identification. The identification device mainly includes laser radar, depth camera, satellite positioning, temperature and humidity, light and other environmental sensors and computing units. The former is also equipped with a mechanical arm device for harvesting, which is mainly used for positioning and tracking in specific agricultural scenes and plant protection and harvesting. The technical solutions disclosed by the two have the following deficiencies:
[0005] (1) The solution with integrated motion mechanism and identification device has poor adaptability to agricultural implementation scenarios, mainly including the travelability of the chassis drive device and environmental adaptability, such as the width of the field pit and whether there is mud. Different crops have different growth heights and planting densities in plant protection scenarios, which requires the deployment location of the identification device. Due to the above two points, the environmental compatibility of the device with integrated motion mechanism and identification device affects the general applicability of the device.
[0006] (2) The system focuses mainly on plant protection and lacks the function of inspecting agricultural facilities and pipelines, such as irrigation systems, supporting trellises, detection sensors and other facilities. For large-scale modern agricultural scenarios, this function can significantly reduce the labor cost of maintaining the operation of agricultural systems.
[0007] (3) Agricultural scenarios are cost-sensitive. The sensors and computing power solutions mentioned above are expensive. Multi-line lidar and depth camera sensors are precision electromechanical devices with high maintenance and repair costs. In addition, data quality is greatly affected by dust, rain and fog. The use of a general computing platform solution further increases costs. Summary of the invention
[0008] The purpose of the present invention is to provide a visual multi-task mounted agricultural inspection method and device based on deep learning, which is mainly based on vision and can use visual deep learning information mining as much as possible while controlling costs, and provides mechanical and electrical interfaces in structural design to be compatible with existing facilities and their post-installation modifications.
[0009] To achieve the above object, the present invention provides a visual multi-task mounted agricultural inspection method based on deep learning, which includes:
[0010] Step 1: multiple cameras are arranged in a circle around the axis of the height direction of the agricultural machinery to form a 360° panoramic view of the environment outside the chassis of the agricultural machinery with the same optical center. The images collected by all cameras are synchronously transmitted to the multi-task target detection and semantic classification model for parallel reasoning to obtain the two-dimensional detection frame and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each target;
[0011] Step 2: extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, and pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera to obtain multiple groups of feature point matching pairs, each group of feature point matching pairs is the pixel point coordinates of the same feature in the first and second cameras respectively;
[0012] Step 3, using step 2 to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, perform semantic target association and fusion positioning, and obtain the corresponding spatial position of the agricultural machinery in the constructed map during the movement process;
[0013] Step 4, using the multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras obtained in step 2, and the corresponding spatial positions in the constructed map during the movement of the agricultural machinery obtained in step 3, to perform maintenance tasks for crops or facilities.
[0014] Furthermore, the "semantic target association and fusion positioning" in step 3 specifically includes:
[0015] Step 31, semantic target association and positioning: determine whether the multiple feature point matching pairs of the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the first and second camera fields of view, and estimate the spatial position of the associated target in the own coordinate system with its own position as the origin; wherein the own coordinate system adopts a right-hand system, with the horizontal axis x taking the right direction of itself as the positive direction, and the vertical axis y taking the forward direction of itself as the positive direction;
[0016] Step 32, fusion positioning: extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in the coordinate system of the agricultural machinery at the current time in the same way as step 31. N , the N targets include the first target and other N-1 targets, obtain the spatial relative positions of the other N-1 targets relative to the first target, and take the result obtained by negating the spatial position P1 of the first target as the spatial position of the agricultural machinery with the first target as the coordinate origin. According to the above method, a local coordinate system and map with the first target as the origin, the forward and right directions of the current agricultural machinery as the XY two-dimensional coordinate axes, and the other N-1 targets as reference points are obtained;
[0017] Through target tracking association, using the principle of multi-point spatial positioning and combining the chassis wheel speed odometer, the new spatial positions P of the N targets in the agricultural machinery's own coordinate system at time T+1 are obtained. 1' ~P N' The relative offset distance is calculated by the invariance of the plant target spatial position, and then the corresponding spatial position in the constructed map is updated during the movement of the agricultural machinery.
[0018] Furthermore, the "crop or facility maintenance tasks" in step 4 include crop pest detection, crop lodging detection, facility damage detection and equipment status inspection; among which:
[0019] Crop pest detection specifically includes: based on the two-dimensional detection frame of a single crop target of each camera, combined with the outline of the original image of the crop selected by semantic segmentation, to identify the pest and disease area of the single crop target, and at the same time report the position information obtained by fusion positioning;
[0020] The crop lodging detection specifically includes: based on the two-dimensional detection frame of the single crop target of each camera, combined with the outline of the original image of the crop selected by semantic segmentation, the image is first binarized to obtain a binary bitmap, and then the binary bitmap is weakened by the image corrosion method, and the main trunk is strengthened by the image expansion method. Then, the main trunk direction vector is obtained by the principal component analysis method, and the main trunk inclination of the plant is calculated. It is compared with the lodging reference value to determine the lodging state of the single crop target, and the self-position information obtained by the fusion positioning is reported;
[0021] The facility damage detection specifically includes: according to the two-dimensional detection frame of the facility target of each camera, combined with the outline of the original image of the facility target intercepted by semantic segmentation, using the multi-camera calibration parameters, the image within the semantic outline area across cameras is feature matched and aligned and cylindrically projected, the semantics of the same facility are associated to form a complete and continuous semantic outline, the damaged area within the semantic outline is detected, and the self-position information obtained by fusion positioning is reported;
[0022] The equipment status inspection specifically includes: whether there is any equipment that needs to be inspected in the map at the location obtained by searching and fusion positioning. If so, the image is collected by the camera, and the outline of the equipment target is intercepted by the two-dimensional detection frame of each camera and the semantic segmentation is used to detect the equipment target. The equipment targets include power distribution facilities, instrument panels and indicator lights. The OCR technology is used to recognize the characters and numbers on the instrument panel, and the recorded sensor point information is parsed into the corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
[0023] Furthermore, in step 1, the method of surrounding the plurality of cameras in a circle around the axis along the height direction of the agricultural machinery includes:
[0024] T1, aggregated deployment surround view: a number of cameras are arranged around an axis perpendicular to the body of the agricultural machine, forming a 360° surround view of the environment outside the small chassis agricultural machine with the same optical center;
[0025] T2, Separate deployment surround view: Several cameras are dispersedly set up to form a 360° surround view of the environment outside the large chassis agricultural machinery with the same optical center.
[0026] Furthermore, the method for obtaining the multi-task object detection and semantic classification model includes:
[0027] Step 11, obtaining the camera's calibration internal and external parameters, and selecting targets and scenes; wherein the targets include facilities and equipment and individual crops, and the environment includes traversable areas, crops, facilities and equipment;
[0028] Step 12, collect and clean image data in the scene to obtain a training test set, and annotate the training test set into two categories, namely a monocular discrete scene data set and a multi-camera associated surround continuous data set. The monocular discrete scene is that a single camera in each direction collects images at discrete time intervals to ensure the diversity of the collected scenes. The multi-camera association is that cameras in each direction collect images simultaneously and in continuous time periods to ensure that the images of each camera have spatial and temporal consistency; wherein the annotation label types include a two-dimensional detection box for target-level recognition and a semantic classification outline for pixel-level scene annotation. The training, verification, and evaluation are randomly screened according to a preset ratio to obtain a training data subset, a verification data subset, and an evaluation data subset;
[0029] Step 13: Based on the labeled training data subset, the Yolop multi-task network model uses one target detection head and two semantic segmentation heads to adapt the scene detection task to the division of labor, as shown in the following table, to obtain the target category:
[0030]
[0031]
[0032] Step 14: quantify the multi-task target detection and semantic classification model after training and index testing according to the labeled validation data subset, set the typical parallel inference channel number of the multi-task target detection and semantic classification model to multiple channels, and match the number of cameras;
[0033] Step 15: Based on the labeled evaluation data subset, re-test the quantized multi-task target detection and semantic classification model to verify whether the indicator loss meets expectations and check whether there are obvious false detection and missed detection problems in the evaluation data subset.
[0034] The present invention also provides a visual multi-task mounted agricultural inspection device based on deep learning, which includes:
[0035] Multiple cameras are arranged in a circle around the axis of the height direction of the agricultural machinery to form a 360° panoramic view of the environment outside the chassis agricultural machinery with the same optical center;
[0036] The multi-task object detection and semantic classification model is used to receive images collected synchronously by all cameras, perform parallel reasoning, and obtain a two-dimensional detection box and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each object;
[0037] A feature matching unit is used to extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, and to pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera to obtain multiple groups of feature point matching pairs, each group of feature point matching pairs is the pixel point coordinates of the same feature in the first and second cameras respectively;
[0038] The agricultural machinery spatial position acquisition unit is used to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras by using the feature matching unit, perform semantic target association and fusion positioning, and obtain the corresponding spatial position of the agricultural machinery in the constructed map during its movement;
[0039] The inspection execution unit is used to use the feature matching unit to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, and the agricultural machinery spatial position acquisition unit to obtain the corresponding spatial position of the agricultural machinery in the constructed map during the movement of the agricultural machinery, so as to perform maintenance tasks for crops or facilities.
[0040] Furthermore, the agricultural machinery spatial position acquisition unit specifically includes:
[0041] The semantic target association and positioning subunit is used to execute step 31: determine whether the multiple sets of feature point matching pairs existing in the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the first and second camera fields of view, and estimate the spatial position of the associated target in the own coordinate system with its own position as the origin; wherein the own coordinate system adopts a right-hand system, with the horizontal axis x taking the right direction of itself as the positive direction, and the vertical axis y taking the forward direction of itself as the positive direction;
[0042] The fusion positioning subunit is used to execute step 32: extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in the coordinate system of the agricultural machinery at the current time in the same way as step 31. N , the N targets include the first target and other N-1 targets, obtain the spatial relative positions of the other N-1 targets relative to the first target, and take the result obtained by negating the spatial position P1 of the first target as the spatial position of the agricultural machinery with the first target as the coordinate origin. According to the above method, a local coordinate system and map with the first target as the origin, the forward and right directions of the current agricultural machinery as the XY two-dimensional coordinate axes, and the other N-1 targets as reference points are obtained;
[0043] Through target tracking association, using the principle of multi-point spatial positioning and combining the chassis wheel speed odometer, the new spatial positions P of the N targets in the agricultural machinery's own coordinate system at time T+1 are obtained. 1' ~P N'The relative offset distance is calculated by the invariance of the plant target spatial position, and then the corresponding spatial position in the constructed map is updated during the movement of the agricultural machinery.
[0044] Furthermore, the inspection execution unit specifically includes:
[0045] The crop pest detection subunit is used to identify the pest and disease areas of the single crop target based on the two-dimensional detection frame of the single crop target of each camera and the outline of the original image of the crop selected by semantic segmentation, and report the position information of the single crop target obtained by fusion positioning;
[0046] The crop lodging detection subunit is used to binarize the image according to the two-dimensional detection frame of the single crop target of each camera, combined with the outline of the original image of the crop selected by semantic segmentation, to obtain a binary bitmap, then use the image erosion method to weaken the branches and leaves of the binary bitmap, use the image dilation method to strengthen the trunk, and then use the principal component analysis method to obtain the trunk direction vector, solve the trunk inclination angle of the plant, and compare it with the lodging reference value to determine the lodging state of the single crop target, and at the same time report the self-position information obtained by the fusion positioning;
[0047] The facility damage detection subunit is used to perform feature matching alignment and cylindrical projection on the images within the semantic contour area across cameras based on the two-dimensional detection frame of the facility target of each camera, combined with the contour of the original image of the facility target intercepted by semantic segmentation, using the calibration parameters of the multi-camera, associate the semantics of the same facility, form a complete and continuous semantic contour, detect the situation of the damaged area within the semantic contour, and report the self-position information obtained by fusion positioning;
[0048] The equipment status inspection subunit is used to retrieve whether there is any equipment that needs to be inspected in the map based on its own position obtained by fusion positioning. If so, the camera is used to capture images, and the two-dimensional detection frame of the equipment target of each camera is combined with the outline of the equipment target intercepted by semantic segmentation. The equipment targets include power distribution facilities, instrument panels and indicator lights. The OCR technology is used to recognize the characters and numbers on the instrument panel, and the recorded sensor point information is parsed into the corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
[0049] Furthermore, the manner in which the plurality of cameras are arranged in a circle around an axis in the height direction of the agricultural machinery includes:
[0050] T1, aggregated deployment surround view: a number of cameras are arranged around an axis perpendicular to the body of the agricultural machine, forming a 360° surround view of the environment outside the small chassis agricultural machine with the same optical center;
[0051] T2, Separate deployment surround view: Several cameras are dispersedly set up to form a 360° surround view of the environment outside the large chassis agricultural machinery with the same optical center.
[0052] Furthermore, the method for obtaining the multi-task object detection and semantic classification model includes:
[0053] Step 11, obtaining the camera's calibration internal and external parameters, and selecting targets and scenes; wherein the targets include facilities and equipment and individual crops, and the environment includes traversable areas, crops, facilities and equipment;
[0054] Step 12, collect and clean image data in the scene to obtain a training test set, and annotate the training test set into two categories, namely a monocular discrete scene data set and a multi-camera associated surround continuous data set. The monocular discrete scene is that a single camera in each direction collects images at discrete time intervals to ensure the diversity of the collected scenes. The multi-camera association is that cameras in each direction collect images simultaneously and in continuous time periods to ensure that the images of each camera have spatial and temporal consistency; wherein the annotation label types include a two-dimensional detection box for target-level recognition and a semantic classification outline for pixel-level scene annotation. The training, verification, and evaluation are randomly screened according to a preset ratio to obtain a training data subset, a verification data subset, and an evaluation data subset;
[0055] Step 13: Based on the labeled training data subset, the Yolop multi-task network model uses one target detection head and two semantic segmentation heads to adapt the scene detection task to the division of labor, as shown in the following table, to obtain the target category:
[0056] Task Number Head Task 1 Object Detection Individual crops and facilities with status lights and meters 2 Semantic Segmentation 1 Pipelines and equipment with damage markings 3 Semantic Segmentation II Non-target crops: weeds and crops with pests and diseases
[0057] Step 14: quantify the multi-task target detection and semantic classification model after training and index testing according to the labeled validation data subset, set the typical parallel inference channel number of the multi-task target detection and semantic classification model to multiple channels, and match the number of cameras;
[0058] Step 15: Based on the labeled evaluation data subset, re-test the quantized multi-task target detection and semantic classification model to verify whether the indicator loss meets expectations and check whether there are obvious false detection and missed detection problems in the evaluation data subset.
[0059] The present invention uses a multi-camera surround vision sensor solution and a visual multi-task network to complete the target detection and semantic segmentation tasks of multiple cameras in parallel, realize crop and facility recognition and environment segmentation, and further complete the three tasks of positioning, crop protection, and facility inspection. It mainly optimizes and solves the following two problems:
[0060] 1. The multi-camera surround sensor hardware solution is adopted, and the componentized inspection device that can be installed later is integrated. Through the adapter, it can match various existing planting and harvesting machinery. For the scenes with the demand for automatic chassis wire control, it has a wire control interface to realize remote or automatic control;
[0061] 2. Multi-eye pure vision algorithm solution, multi-task visual network training, quantization, parallel reasoning, combined with civilian-grade GPS to achieve self-positioning based on environmental characteristics and complete maintenance tasks of crops and facilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1a It is a schematic diagram of the arrangement of the aggregated deployment surround on the agricultural machinery according to an embodiment of the present invention.
[0063] Figure 1b yes Figure 1a Schematic diagram of the first surround view formed by the aggregated deployment of surround view cameras.
[0064] Figure 2 yes Figure 1a Schematic diagram of the structure of the camera arrangement for aggregated deployment and surround view.
[0065] Figure 3a It is a schematic diagram of the arrangement of the separated deployment surround on the agricultural machinery according to an embodiment of the present invention.
[0066] Figure 3b yes Figure 3a Schematic diagram of a second surround view formed by separately deployed surround view cameras.
[0067] Figure 4 Schematic diagram of projection segmentation according to an embodiment of the present invention.
[0068] Figure 5 It is a schematic diagram of feature matching according to an embodiment of the present invention.
[0069] Figure 6 It is a schematic diagram of fusion matching positioning according to an embodiment of the present invention.
[0070] Figure 7 It is a schematic diagram of fusion positioning according to an embodiment of the present invention.
[0071] Figure 8 Schematic diagram of crop pest detection according to an embodiment of the present invention.
[0072] Fig. 9 Schematic diagram of crop lodging detection according to an embodiment of the present invention.
[0073] Fig.10 Schematic diagram of facility damage detection according to an embodiment of the present invention.
[0074] Fig.11It is a schematic diagram of equipment status inspection according to an embodiment of the present invention. DETAILED DESCRIPTION
[0075] In the drawings, the same or similar reference numerals are used to represent the same or similar elements or elements with the same or similar functions. The embodiments of the present invention are described in detail below in conjunction with the drawings.
[0076] In the description of the present invention, the terms "center", "longitudinal", "lateral", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the scope of protection of the present invention.
[0077] The visual multi-task mounted agricultural inspection method based on deep learning provided by an embodiment of the present invention includes:
[0078] Step 1: multiple cameras 1 are arranged in a circle around the axis of the height direction of the agricultural machinery to form a 360° panoramic view of the environment outside the chassis agricultural machinery with the same optical center.
[0079] Camera 1 can be set up in the following way: Figure 1a and 1b The aggregated deployment surround view method shown is suitable for small chassis agricultural machinery. The aggregated deployment surround view method specifically includes: multiple cameras are combined together in a back-to-back manner. In order to facilitate the deployment in an aggregated manner, the shapes of the side and back of the camera 1 match each other, so that the side and back of two adjacent cameras 1 can be fitted together, and then multiple cameras 1 can be arranged in a circle around the axis of the height direction of the agricultural machinery. The fields of view of two adjacent cameras 1 overlap with each other, thereby forming a 360° concentric surround view around the axis of the height direction of the agricultural machinery. Specifically, as Figure 2 As shown, the number of cameras 1 can be 6, and the side and back of the camera 1 are constructed into a columnar structure, and the cross section of the camera 1 in use is trapezoidal in the horizontal direction. Such a structural form is conducive to the side and back of the two cameras 1 fitting each other, and the whole appears compact, while ensuring that the fields of view of the two adjacent cameras 1 overlap with each other, forming a 360° same-optical-center panoramic view around the axis of the height direction of the agricultural machinery. Of course, the number of cameras 1 can also be set to other, as long as it can ensure that a 360° same-optical-center panoramic view of the agricultural machinery is obtained.
[0080] Camera 1 uses multiple single camera sensor circuit modules on the market, and packages the structure and electrical interface to form a combination. It supports surround assembly and discrete component assembly and fixation. The camera lens can be replaced with lenses of different focal lengths, such as 60°, 90°, 120°, and 180°, to capture image frames in the field of view in real time. The camera uses a starlight-level photosensitive element, the image acquisition frame rate is configurable, and the GMSL2 high-speed interface supports a maximum extension distance of 15m. The camera can obtain timing through a clock synchronization cable and add a world timestamp to each frame of the image for post-processing frame synchronization alignment.
[0081] Furthermore, since the aggregated deployment surround view is suitable for small chassis agricultural machinery 5, the overall volume needs to be relatively small, and the auxiliary equipment of the camera 1 needs to form a relatively compact structure with the camera 1 to meet the small overall volume requirements of the small chassis agricultural machinery 5. Figure 2 As shown, a computing unit 2 is arranged above the chassis 5 of the agricultural machinery. For example, an embedded multi-core computing unit with an embedded asynchronous vector AI accelerator can be used, which can support real-time deep convolutional network reasoning and related post-processing tasks. The computing power is sufficient and is equipped with power supply, communication, and chassis wire control interface 4. CAN, RS-485, RS-232, and network interfaces are provided for control and communication with the mechanical chassis and agricultural machinery.
[0082] The camera 1 is provided with a 4G / 5G wireless communication module 3 on the top surface surrounding the computing unit 2. The 4G / 5G wireless communication module 3 is used to communicate with the server through the cellular network and realize functions such as remote control. The camera 1 surrounds the 4G / 5G wireless communication module 3 in this way, so that the functions of each device can be met and the overall structure is very compact.
[0083] In one embodiment, the camera 1 is assembled into one with the 4G / 5G wireless communication module 3 and the computing unit 2 and installed at the top rear of a small chassis agricultural machinery, where "rear" is understood as the direction opposite to the forward direction of travel of the vehicle.
[0084] In one embodiment, the camera 1 can be configured as follows: Figure 3a and 3b The separated deployment surround view method shown in the figure is suitable for large chassis agricultural machinery. The separated deployment surround view method specifically includes: Different from the aggregated deployment surround view method, the cameras are dispersedly set, such as Figure 3b As shown, two cameras 1 are arranged back-to-back on the top surface of the computing unit 2, and the other four cameras 1 are distributed on the legs 8 of the chassis 7 of the large-chassis agricultural machinery to ensure that the fields of view of two adjacent cameras 1 overlap with each other, forming a 360° concentric surround field of view around the axis of the height direction of the agricultural machinery.
[0085] In the above embodiment, step 1 also includes: Figure 4 As shown, the images collected synchronously by all cameras are synchronously transmitted to the multi-task target detection and semantic classification model for parallel reasoning to obtain a two-dimensional detection box and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each target.
[0086] The multi-task target detection and semantic classification model is pre-set in the embedded AI computing unit 2. Embedded AI computing unit 2: an embedded multi-core computing unit with an embedded asynchronous vector AI accelerator, capable of supporting real-time deep convolutional network reasoning and related post-processing tasks, with sufficient computing power and equipped with a network communication interface, hereinafter referred to as the computing unit.
[0087] Step 2: extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera, and obtain multiple groups of feature point matching pairs, each group of feature point matching pairs is the pixel point coordinates of the same feature in the first and second cameras respectively.
[0088] Using traditional edge detection algorithms such as Sobel operator and Canny edge detector, the boundaries of different semantic categories in the semantic segmentation map are extracted as the features of the camera in the field of view, and the semantic bitmaps of two adjacent channel cameras are matched through traditional feature matching methods such as the FLANN-based matcher. Figure 5 As shown, Figure 5 For example, the left and right adjacent cameras have overlapping fields of view. The semantic boundary feature points of the left and right cameras are paired through the FLANN matcher to obtain multiple feature point matching pairs. Each feature point matching pair is the pixel coordinates of the same feature in the left and right cameras. Taking plant 1 as an example, its stems and leaves are successfully matched in multiple places in the fields of view of the left and right cameras, respectively, forming multiple matching pairs that are managed in a mapping manner. For example
[0089] P left (x1,y1),Q right (x1,y1)
[0090] P left (x2,y2),Q right (x2,y2) ...
[0092] Step 3, using step 2 to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, to perform semantic target association and fusion positioning, and maintenance tasks of crops or facilities.
[0093] In one embodiment, the “semantic target association and fusion positioning” in step 3 specifically includes:
[0094] Step 31, semantic target association and positioning: determine whether the multiple feature point matching pairs of the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the first and second camera fields of view, and estimate the spatial position of the associated target in the own coordinate system with its own position as the origin. The own coordinate system adopts a right-hand system, with the horizontal axis x as the positive direction and the vertical axis y as the positive direction.
[0095] by Figure 5 As shown in the figure, for example, multiple feature point matching pairs of plant 1 in the left camera are all located in the two-dimensional detection frame of the first plant in the right camera (gray dotted line), and thus plant 1 is associated with the same plant in the overlapping area of the left and right cameras. Figure 6 As shown; the spatial position of the plant relative to its own coordinate system can be estimated by binocular ranging method.
[0096] Step 32, fusion positioning: extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in their own coordinate system at the current time in the same way as step 31. N The N targets include the first target and other N-1 targets. The spatial positions of the other N-1 targets relative to the first target are obtained, that is, the difference between the spatial position P1 of the first target and the spatial positions of the other N-1 targets is taken, and the result of the negative operation of the spatial position P1 of the first target is taken as the spatial position of the agricultural machinery with the first target as the coordinate origin, so as to obtain a local coordinate system and map with the first target as the origin and the other N-1 targets as reference points.
[0097] Through target tracking association, using the principle of multi-point spatial positioning and combining the chassis wheel speed odometer, the new spatial positions P of the N targets in their own coordinate systems at time T+1 are obtained. 1' ~P N' , and then obtain the relative offset distance and spatial position of the agricultural machinery in the map.
[0098] like Figure 7 As shown in the figure, taking the 6-eye surround view as an example, at time T, taking plant A as an example, the target is associated with the same plant through the forward camera and the left front direction through semantic feature matching, and the positioning coordinate P in its own coordinate system is solved. A In this way, multiple fixed plants A~F surrounding the plant are extracted in the overlapping area of the camera field of view in each direction, and target association and spatial positioning are performed to obtain P A ~P FBy subtracting the spatial positions of plants B to F from those of plants A, we can calculate the spatial positions of plants B to F relative to A, and convert P A Taking the negative operation, it can be used as the position of the device in the space with A as the coordinate origin. Thus, a local coordinate system and map M with A as the origin and B~F as reference points are constructed. T As the device continues to move forward, the positions of plants A to F shift in the field of view in all directions. Through target tracking association based on traditional filtering algorithms such as Kalman filtering, at time T+1, each plant is relatively behind the device. Taking plant A as an example, at this moment, it can be observed through the left front camera and the left rear direction, and the new spatial position P of the plant can be obtained. A' As can be seen from the figure, other plants B, E, and F can still obtain relative positioning P through the semantic target association and positioning method across cameras. A' P B' P E' P F' Since the plant has spatial position invariance, the multi-point spatial positioning method can actually be used to solve the equipment based on M T The relative offset distance d and M in the map T Spatial position, thereby realizing the device's own fusion positioning function in continuous scenes through continuous observation and association.
[0099] In one embodiment, the "crop or facility maintenance tasks" in step 3 include crop pest detection, crop lodging detection, facility damage detection, and equipment status inspection; wherein:
[0100] The crop pest detection specifically includes: according to the two-dimensional detection frame of the single crop target of each camera in step 1, combined with the outline of the original image of the crop selected by semantic segmentation, to identify the pest and disease area of the single crop target.
[0101] like Figure 8 As shown in the figure, the target detection model can identify the two-dimensional detection frame of a single crop plant, combine the semantic segmentation of the frame to intercept the original image contour of the crop plant, and retrieve and annotate the pest and disease areas identified by the semantic segmentation task 2. At the same time, the self-position information obtained by the fusion positioning is reported to complete the pest detection task.
[0102] The crop lodging detection specifically includes: according to the two-dimensional detection frame of the single crop target of each camera in step 1 and the outline of the single crop target, the image is first binarized to obtain a binary bitmap, and then the binary bitmap is weakened by branches and leaves and strengthened by graphics methods such as expansion, and then principal component analysis is performed, and the main trunk of the plant is extracted by principal component analysis, factor analysis, etc., and the main trunk direction vector is obtained. The inclination angle of the main trunk of the plant is solved and compared with the lodging reference value to determine the lodging state of the single crop target.
[0103] like Fig. 9 As shown in the figure, the target detection model can identify the two-dimensional detection frame of a single crop plant, and the original image contour of the crop plant can be intercepted by combining the semantic segmentation of the frame. The branches and leaves are weakened by image erosion after image binarization, and the trunk is strengthened by image expansion. The principal component analysis is performed on the processed binary bitmap, and the trunk direction vector is obtained to solve the trunk inclination angle α of the plant. By comparing the lodging reference value of the plant, it is determined whether the plant is in a lodging state.
[0104] The facility damage detection specifically includes: according to the two-dimensional detection frame of the facility target of each camera in step 1 and the outline of the facility target, the multi-camera calibration parameters are used to perform coplanar projection based on feature matching on the semantic outline across cameras, the semantics of the same facility are associated to form a complete and continuous semantic outline, and abnormal conditions such as damaged areas and truncation within the semantic outline are detected. At the same time, the own position information obtained by the fusion positioning is reported.
[0105] like Fig.10 As shown in the figure, taking pipeline truncation detection as an example, target detection and semantic segmentation are performed on the left and right cameras respectively, the semantic contour of the pipeline is extracted, and the cross-camera semantic contour is coplanarly projected based on feature matching using the multi-camera calibration parameters. The semantics of the same facility are associated to form a complete and continuous semantic contour, and it is detected whether there is a damaged area within the semantic contour.
[0106] The equipment status inspection specifically includes: according to the two-dimensional detection frame of the equipment target of each camera in step 1 and the outline of the equipment target, the equipment target includes power distribution facilities, instrument panels and indicator lights, the characters and numbers on the instrument panel are recognized and parsed into sensor numerical information, and the indicator light switch status is recognized through color recognition.
[0107] like Fig.11As shown, by searching the fusion positioning to determine whether there is any equipment that needs to be inspected in the map, if so, the camera is used to capture images, and the two-dimensional detection frame of the equipment target of each camera is combined with the outline of the equipment target intercepted by semantic segmentation. The equipment targets include power distribution facilities, instrument panels, and indicator lights. OCR (Optical Character Recognition) technology is used to recognize characters and numbers on the instrument panel, and the recorded sensor point information is parsed into corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
[0108] In one embodiment, a method for acquiring a multi-task object detection and semantic classification model includes:
[0109] Step 11, obtain the calibration internal and external parameters of the camera, and select the target and scene. Among them, the targets include facilities and equipment and individual crops, and the environment includes passable areas, crops, facilities and equipment. The internal parameter calibration adopts the mature checkerboard calibration method to obtain the internal parameter focal length, distortion parameters, etc. The external parameter calibration can be performed in a joint multi-eye vision calibration room. The scene mainly refers to the selection of features or targets that need to be identified and classified according to the operating scene; the main targets involved in this embodiment mainly include identification targets and environmental classification. Specifically, the identification targets mainly include facilities and equipment (indicator lights, instruments) and individual crops, and the environmental classification targets mainly include passable areas, crops, and facilities (pipelines).
[0110] Step 12, collect and clean the image data in the scene to obtain a training test set, and mark the training test set into two categories, namely a monocular discrete scene data set and a multi-camera associated surround continuous data set. The monocular discrete scene is that a single camera in each direction collects images at discrete time intervals to ensure the diversity of the collected scenes. The multi-camera association is that cameras in each direction collect images simultaneously and in continuous time periods to ensure that the images of each camera have spatial and temporal consistency.
[0111] When collecting and cleaning data, if the agricultural operating environment varies greatly and the agricultural machinery adaptation scenes (crops, facilities) change significantly, it is necessary to collect and store multiple sets of camera surround images through the computing unit in the operating scene, and perform data cleaning, sparse sampling, remove duplicate scenes, and evenly distribute scenes to reduce the data size. The remaining data scenes are diverse and uniform.
[0112] The annotation label types include two-dimensional detection boxes for object-level recognition and semantic classification contours for pixel-level scene annotation. Training, verification, and evaluation are randomly screened according to a preset ratio, for example, 5:3:2, to obtain training data subsets, verification data subsets, and evaluation data subsets.
[0113] Step 13, for deep learning needs that require both target recognition and scene segmentation, a multi-task network is used to complete low-dimensional feature extraction and high-dimensional detection and classification tasks in a single inference. This embodiment uses the mature open source model solution Yolop multi-task network model, and uses a pre-trained model based on a public data set as the basis for fine-tuning. According to the labeled training data subset, through a target detection head and two semantic segmentation heads of the Yolop multi-task network model, the scene detection task is adapted for division of labor. After training, verification, and evaluation, the target scene detection accuracy, recall rate, and mIOU indicators are met. These expectations are completed, and the model training is completed. As shown in the following table, the target category is obtained:
[0114] Task Number Head Task 1 Object Detection Individual crops and facilities with status lights and meters 2 Semantic Segmentation 1 Pipelines and equipment with damage markings 3 Semantic Segmentation II Non-target crops: weeds and crops with pests and diseases
[0115] After training and index testing, the model needs to be quantized. The TensorRT tool is used for quantization, and the typical number of parallel inference channels of the model is set to multiple channels to match the number of cameras in this embodiment. The quantized model needs to be retested to verify whether the index loss meets expectations and to check whether there are obvious false detections and missed detections in the evaluation data subset.
[0116] Step 14: quantify the multi-task target detection and semantic classification model after training and index testing based on the labeled validation data subset, set the typical parallel inference channel number of the multi-task target detection and semantic classification model to multiple channels, and match the number of cameras.
[0117] Step 15: Based on the labeled evaluation data subset, re-test the quantized multi-task target detection and semantic classification model to verify whether the indicator loss meets expectations and check whether there are obvious false detection and missed detection problems in the evaluation data subset.
[0118] The embodiment of the present invention further provides a visual multi-task mounted agricultural inspection device based on deep learning, which includes multiple cameras, a multi-task target detection and semantic classification model, a feature matching unit, an agricultural machinery spatial position acquisition unit and an inspection execution unit, wherein:
[0119] Multiple cameras are arranged in a circle around the axis of the height direction of the agricultural machinery, forming a 360° panoramic view of the environment outside the chassis of the agricultural machinery with the same optical center.
[0120] The multi-task object detection and semantic classification model is used to receive images collected synchronously by all cameras, perform parallel reasoning, and obtain a two-dimensional detection box and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each object.
[0121] The feature matching unit is used to extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, and to pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera to obtain multiple groups of feature point matching pairs, each group of feature point matching pairs being the pixel point coordinates of the same feature in the first and second cameras respectively.
[0122] The agricultural machinery spatial position acquisition unit is used to use the feature matching unit to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, perform semantic target association and fusion positioning, and obtain the corresponding spatial position of the agricultural machinery in the constructed map during its movement.
[0123] The inspection execution unit is used to use the feature matching unit to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, and the agricultural machinery spatial position acquisition unit to obtain the corresponding spatial position of the agricultural machinery in the constructed map during its movement, so as to perform maintenance tasks for crops or facilities.
[0124] In one embodiment, the agricultural machinery spatial position acquisition unit specifically includes a semantic target association and positioning subunit and a fusion positioning subunit, wherein:
[0125] The semantic target association and positioning subunit is used to determine whether the multiple sets of feature point matching pairs of the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the field of view of the first and second cameras, and the spatial position of the associated target in its own coordinate system with its own position as the origin is estimated; wherein the own coordinate system adopts a right-hand system, with the horizontal axis x as the positive direction to the right of itself and the vertical axis y as the positive direction to the front of itself.
[0126] The fusion positioning subunit is used to extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in the agricultural machinery's own coordinate system at the current time in the same way as step 31. N , N targets include the first target and other N-1 targets, obtain the spatial relative positions of the other N-1 targets relative to the first target, and take the result obtained by negating the spatial position P1 of the first target as the spatial position of the agricultural machinery with the first target as the coordinate origin. According to the above method, a local coordinate system and map with the first target as the origin, the forward and right directions of the current agricultural machinery are the XY two-dimensional coordinate axes, and the other N-1 targets are reference points. Through target tracking association, using the principle of multi-point spatial positioning, combined with the chassis wheel speed odometer, the new spatial positions P of the N targets in the agricultural machinery's own coordinate system at time T+1 are obtained. 1' ~P N'The relative offset distance is calculated by the invariance of the plant target spatial position, and then the corresponding spatial position in the constructed map is updated during the movement of the agricultural machinery.
[0127] In one embodiment, the inspection execution unit specifically includes a crop pest detection subunit, a crop lodging detection subunit, a facility damage detection subunit and an equipment status inspection subunit, wherein:
[0128] The crop pest detection subunit is used to identify the pest and disease areas of a single crop target based on the two-dimensional detection frame of the single crop target of each camera and the outline of the original image of the crop selected by semantic segmentation, and at the same time report its own position information obtained by fusion positioning.
[0129] The crop lodging detection subunit is used to binarize the image according to the two-dimensional detection frame of the single crop target of each camera and the outline of the original image of the crop selected by semantic segmentation to obtain a binary bitmap, then use the image erosion method to weaken the branches and leaves of the binary bitmap, use the image dilation method to strengthen the trunk, and then use the principal component analysis method to obtain the trunk direction vector, solve the trunk inclination angle of the plant, and compare it with the lodging reference value to determine the lodging state of the single crop target, and at the same time report the self-position information obtained by the fusion positioning.
[0130] The facility damage detection subunit is used to perform feature matching alignment and cylindrical projection on the images within the semantic contour area across cameras based on the two-dimensional detection frame of the facility target of each camera, combined with the contour of the original image of the facility intercepted by semantic segmentation, using the calibration parameters of the multi-camera, and associate the semantics of the same facility to form a complete and continuous semantic contour, detect the situation of the damaged area within the semantic contour, and report the self-position information obtained by fusion positioning.
[0131] The equipment status inspection subunit is used to retrieve whether there is any equipment that needs to be inspected in the map based on its own position obtained by fusion positioning. If so, the camera is used to capture images, and the two-dimensional detection frame of the equipment target of each camera is combined with the outline of the equipment target intercepted by semantic segmentation. The equipment targets include power distribution facilities, instrument panels and indicator lights. The OCR technology is used to recognize the characters and numbers on the instrument panel, and the recorded sensor point information is parsed into the corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
[0132] The present invention realizes cost control with a hardware solution mainly based on multi-camera surround vision, uses visual multi-task deep learning to extract information such as crops and facility status, realizes global positioning and planning through continuous scene association, and provides a mechanical wire control communication interface, which is compatible with the after-sales intelligent transformation of existing agricultural machinery and equipment, thereby improving economic benefits.
[0133] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Those skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features thereof may be replaced by equivalents; these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A visual multi-task mounted agricultural inspection method based on deep learning, characterized in that: include: Step 1: multiple cameras are arranged in a circle around the axis of the height direction of the agricultural machinery to form a 360° panoramic view of the environment outside the chassis of the agricultural machinery with the same optical center. The images collected by all cameras are synchronously transmitted to the multi-task target detection and semantic classification model for parallel reasoning to obtain the two-dimensional detection frame and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each target; Step 2: extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, and pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera to obtain multiple groups of feature point matching pairs, each group of feature point matching pairs is the pixel point coordinates of the same feature in the first and second cameras respectively; Step 3, using step 2 to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, perform semantic target association and fusion positioning, and obtain the corresponding spatial position of the agricultural machinery in the constructed map during the movement process; Step 4, using the multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras obtained in step 2 and the corresponding spatial positions in the constructed map during the movement of the agricultural machinery obtained in step 3, to perform maintenance tasks for crops or facilities; The method for obtaining the multi-task object detection and semantic classification model includes: Step 11, obtaining the camera's calibration internal and external parameters, and selecting targets and scenes; wherein the targets include facilities and equipment and individual crops, and the environment includes traversable areas, crops, facilities and equipment; Step 12, collect and clean image data in the scene to obtain a training test set, and annotate the training test set into two categories, namely a monocular discrete scene data set and a multi-camera associated surround continuous data set. The monocular discrete scene is that a single camera in each direction collects images at discrete time intervals to ensure the diversity of the collected scenes. The multi-camera association is that cameras in each direction collect images simultaneously and in continuous time periods to ensure that the images of each camera have spatial and temporal consistency; wherein the annotation label types include a two-dimensional detection box for target-level recognition and a semantic classification outline for pixel-level scene annotation. The training, verification, and evaluation are randomly screened according to a preset ratio to obtain a training data subset, a verification data subset, and an evaluation data subset; Step 13: Based on the labeled training data subset, the Yolop multi-task network model uses one target detection head and two semantic segmentation heads to adapt the scene detection task to the division of labor, as shown in the following table, to obtain the target category: Step 14: quantify the multi-task target detection and semantic classification model after training and index testing according to the labeled validation data subset, set the typical parallel inference channel number of the multi-task target detection and semantic classification model to multiple channels, and match the number of cameras; Step 15: Based on the labeled evaluation data subset, re-test the quantized multi-task target detection and semantic classification model to verify whether the indicator loss meets expectations and check whether there are obvious false detection and missed detection problems in the evaluation data subset.
2. The visual multi-task mounted agricultural inspection method based on deep learning as claimed in claim 1, characterized in that: The "semantic target association and fusion positioning" in step 3 specifically includes: Step 31, semantic target association and positioning: determine whether the multiple feature point matching pairs of the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the first and second camera fields of view, and estimate the spatial position of the associated target in the own coordinate system with its own position as the origin; wherein the own coordinate system adopts a right-hand system, with the horizontal axis x taking the right direction of itself as the positive direction, and the vertical axis y taking the forward direction of itself as the positive direction; Step 32, fusion positioning: extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in the coordinate system of the agricultural machinery at the current time in the same way as step 31. N , the N targets include the first target and other N-1 targets, obtain the spatial relative positions of the other N-1 targets relative to the first target, and take the result obtained by negating the spatial position P1 of the first target as the spatial position of the agricultural machinery with the first target as the coordinate origin, that is, obtain the local coordinate system and map with the first target as the origin, the forward and right directions of the current agricultural machinery as the XY two-dimensional coordinate axes, and the other N-1 targets as reference points; Through target tracking association, using the principle of multi-point spatial positioning and combining the chassis wheel speed odometer, the new spatial positions P of the N targets in the agricultural machinery's own coordinate system at time T+1 are obtained. 1' ~P N' The relative offset distance is calculated by the invariance of the plant target spatial position, and then the corresponding spatial position in the constructed map is updated during the movement of the agricultural machinery.
3. The visual multi-task mounted agricultural inspection method based on deep learning as claimed in claim 1, characterized in that: The "crop or facility maintenance tasks" in step 4 include crop pest detection, crop lodging detection, facility damage detection and equipment status inspection; among which: Crop pest detection specifically includes: based on the two-dimensional detection frame of a single crop target of each camera, combined with the outline of the original image of the single crop selected by semantic segmentation, to identify the pest and disease area of the single crop target, and at the same time report the position information obtained by fusion positioning; The crop lodging detection specifically includes: based on the two-dimensional detection frame of the single crop target of each camera, combined with the outline of the original image of the single crop selected by semantic segmentation, the image is first binarized to obtain a binary bitmap, and then the binary bitmap is weakened by the image corrosion method, and the main trunk is strengthened by the image expansion method. Then, the main trunk direction vector is obtained by the principal component analysis method, and the main trunk inclination of the plant is calculated. It is compared with the lodging reference value to determine the lodging state of the single crop target, and the self-position information obtained by the fusion positioning is reported; The facility damage detection specifically includes: according to the two-dimensional detection frame of the facility target of each camera, combined with the outline of the original image of the facility target intercepted by semantic segmentation, using the multi-camera calibration parameters, the image within the semantic outline area across cameras is feature matched and aligned and cylindrically projected, the semantics of the same facility are associated to form a complete and continuous semantic outline, the damaged area within the semantic outline is detected, and the self-position information obtained by fusion positioning is reported; The equipment status inspection specifically includes: whether there is any equipment that needs to be inspected in the map at the location obtained by searching and fusion positioning. If so, the image is collected by the camera, and the outline of the equipment target is intercepted by the two-dimensional detection frame of each camera and the semantic segmentation is used to detect the equipment target. The equipment targets include power distribution facilities, instrument panels and indicator lights. The OCR technology is used to recognize the characters and numbers on the instrument panel, and the recorded sensor point information is parsed into the corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
4. The visual multi-task mounted agricultural inspection method based on deep learning as described in any one of claims 1 to 3, characterized in that: In step 1, the method of surrounding the plurality of cameras in a circle around the axis along the height direction of the agricultural machinery includes: T1, aggregated deployment surround view: a number of cameras are arranged around an axis perpendicular to the body of the agricultural machine, forming a 360° surround view of the environment outside the small chassis agricultural machine with the same optical center; T2, Separate deployment surround view: Several cameras are dispersedly set up to form a 360° surround view of the environment outside the large chassis agricultural machinery with the same optical center.
5. A visual multi-task mounted agricultural inspection device based on deep learning, characterized in that: include: Multiple cameras are arranged in a circle around the axis of the height direction of the agricultural machinery to form a 360° panoramic view of the environment outside the chassis agricultural machinery with the same optical center; The multi-task object detection and semantic classification model is used to receive images collected synchronously by all cameras, perform parallel reasoning, and obtain a two-dimensional detection box and semantic segmentation map based on the scene detection task corresponding to each camera. The semantic segmentation map contains the category and outline of each object; A feature matching unit is used to extract the boundary points of the contour in the semantic segmentation map of each camera as the semantic boundary feature points of the corresponding camera, and to pair the semantic boundary feature points in the overlapping area of the field of view of the adjacent first camera and the second camera to obtain multiple groups of feature point matching pairs, each group of feature point matching pairs is the pixel point coordinates of the same feature in the first and second cameras respectively; The agricultural machinery spatial position acquisition unit is used to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras by using the feature matching unit, perform semantic target association and fusion positioning, and obtain the corresponding spatial position of the agricultural machinery in the constructed map during its movement; An inspection execution unit, which is used to use the feature matching unit to obtain multiple sets of feature point matching pairs in the overlapping area of the field of view of two adjacent cameras, and the agricultural machinery spatial position acquisition unit to obtain the corresponding spatial position of the agricultural machinery in the constructed map during the movement of the agricultural machinery, so as to perform maintenance tasks for crops or facilities; The method for obtaining the multi-task object detection and semantic classification model includes: Step 11, obtaining the camera's calibration internal and external parameters, and selecting targets and scenes; wherein the targets include facilities and equipment and individual crops, and the environment includes traversable areas, crops, facilities and equipment; Step 12, collect and clean image data in the scene to obtain a training test set, and annotate the training test set into two categories, namely a monocular discrete scene data set and a multi-camera associated surround continuous data set. The monocular discrete scene is that a single camera in each direction collects images at discrete time intervals to ensure the diversity of the collected scenes. The multi-camera association is that cameras in each direction collect images simultaneously and in continuous time periods to ensure that the images of each camera have spatial and temporal consistency; wherein the annotation label types include a two-dimensional detection box for target-level recognition and a semantic classification outline for pixel-level scene annotation. The training, verification, and evaluation are randomly screened according to a preset ratio to obtain a training data subset, a verification data subset, and an evaluation data subset; Step 13: Based on the labeled training data subset, the Yolop multi-task network model uses one target detection head and two semantic segmentation heads to adapt the scene detection task to the division of labor, as shown in the following table, to obtain the target category: Step 14: quantify the multi-task target detection and semantic classification model after training and index testing according to the labeled validation data subset, set the typical parallel inference channel number of the multi-task target detection and semantic classification model to multiple channels, and match the number of cameras; Step 15: Based on the labeled evaluation data subset, re-test the quantized multi-task target detection and semantic classification model to verify whether the indicator loss meets expectations and check whether there are obvious false detection and missed detection problems in the evaluation data subset.
6. The deep learning-based visual multi-task mounted agricultural inspection device according to claim 5, characterized in that: The agricultural machinery spatial position acquisition unit specifically includes: The semantic target association and positioning subunit is used to execute step 31: determine whether the multiple sets of feature point matching pairs existing in the target in the first camera are all within the two-dimensional detection frame of the target in the second camera. If so, the associated target is the same target in the overlapping area of the first and second camera fields of view, and estimate the spatial position of the associated target in the own coordinate system with its own position as the origin; wherein the own coordinate system adopts a right-hand system, with the horizontal axis x taking the right direction of itself as the positive direction, and the vertical axis y taking the forward direction of itself as the positive direction; The fusion positioning subunit is used to execute step 32: extract multiple fixed N targets surrounding the agricultural machinery in the overlapping area of the camera field of view in N directions, and obtain the spatial positions P1~P of the N targets at time T in the coordinate system of the agricultural machinery at the current time in the same way as step 31. N , the N targets include the first target and other N-1 targets, obtain the spatial relative positions of the other N-1 targets relative to the first target, and take the result obtained by negating the spatial position P1 of the first target as the spatial position of the agricultural machinery with the first target as the coordinate origin. According to the above method, a local coordinate system and map with the first target as the origin, the forward and right directions of the current agricultural machinery as the XY two-dimensional coordinate axes, and the other N-1 targets as reference points are obtained; Through target tracking association, using the principle of multi-point spatial positioning and combining the chassis wheel speed odometer, the new spatial positions P of the N targets in the agricultural machinery's own coordinate system at time T+1 are obtained. 1' ~P N' The relative offset distance is calculated by the invariance of the plant target spatial position, and then the corresponding spatial position in the constructed map is updated during the movement of the agricultural machinery.
7. The visual multi-task mounted agricultural inspection device based on deep learning as claimed in claim 5, characterized in that: The inspection execution unit specifically includes: The crop pest detection subunit is used to identify the pest and disease areas of the single crop target based on the two-dimensional detection frame of the single crop target of each camera and the outline of the original image of the single crop selected by semantic segmentation, and report the position information of the single crop target obtained by fusion positioning; The crop lodging detection subunit is used to binarize the image according to the two-dimensional detection frame of the single crop target of each camera, combined with the outline of the original image of the single crop selected by semantic segmentation, to obtain a binary bitmap, then use the image erosion method to weaken the branches and leaves of the binary bitmap, use the image dilation method to strengthen the trunk, and then use the principal component analysis method to obtain the trunk direction vector, solve the trunk inclination of the plant, and compare it with the lodging reference value to determine the lodging state of the single crop target, and at the same time report the self-position information obtained by the fusion positioning; The facility damage detection subunit is used to perform feature matching alignment and cylindrical projection on the images within the semantic contour area across cameras based on the two-dimensional detection frame of the facility target of each camera, combined with the contour of the original image of the facility target intercepted by semantic segmentation, using the calibration parameters of the multi-camera, associate the semantics of the same facility, form a complete and continuous semantic contour, detect the situation of the damaged area within the semantic contour, and report the self-position information obtained by fusion positioning; The equipment status inspection subunit is used to retrieve whether there is any equipment that needs to be inspected in the map based on its own position obtained by fusion positioning. If so, the camera is used to capture images, and the two-dimensional detection frame of the equipment target of each camera is combined with the outline of the equipment target intercepted by semantic segmentation. The equipment targets include power distribution facilities, instrument panels and indicator lights. The OCR technology is used to recognize the characters and numbers on the instrument panel, and the recorded sensor point information is parsed into the corresponding sensor numerical information. The indicator light switch status is recognized through image color recognition.
8. The visual multi-task mounted agricultural inspection device based on deep learning as described in any one of claims 5 to 7, characterized in that: The methods of arranging multiple cameras around an axis along the height direction of the agricultural machinery include: T1, aggregated deployment surround view: a number of cameras are arranged around an axis perpendicular to the body of the agricultural machine, forming a 360° surround view of the environment outside the small chassis agricultural machine with the same optical center; T2, Separate deployment surround view: Several cameras are dispersedly set up to form a 360° surround view of the environment outside the large chassis agricultural machinery with the same optical center.
