A method and system for target detection in remote sensing images based on Kubernetes edge computing clusters

By building a lightweight remote sensing image target detection model in a Kubernetes edge computing cluster, the deployment challenge of remote sensing image target detection methods on resource-constrained devices is solved, achieving efficient remote sensing image target detection, reducing data transmission and processing latency, and meeting the requirements for real-time performance and rapid response.

CN117132890BActive Publication Date: 2025-10-31CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311069140.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2025-10-31
Estimated Expiration
2043-08-23

AI Technical Summary

Technical Problem

Existing deep learning-based remote sensing image target detection methods have high computational and storage requirements, making them difficult to deploy effectively on resource-constrained edge devices, and they also suffer from significant data transmission and processing delays.

Method used

A lightweight remote sensing image target detection model was built using a Kubernetes edge computing cluster. The model used an automated model pruning method based on reinforcement learning using YOLOv5, combined with TensorRT to generate a serialization engine, and containerization technology was used to build the image and deploy it in the edge computing cluster environment for target detection.

Benefits of technology

It reduces the demand for computing and storage resources, simplifies model deployment and management, improves processing efficiency and real-time performance, and meets the needs of rapid response and real-time decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117132890B_ABST
    Figure CN117132890B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for remote sensing image target detection based on a Kubernetes edge computing cluster, comprising: an edge cluster setup module, which uses the Kubernetes container orchestration and management platform to build an edge computing cluster environment; a lightweight remote sensing image target detection model construction module, which builds a lightweight remote sensing image target detection model based on YOLOv5 and an automated model pruning method using reinforcement learning; a remote sensing image target detection model inference engine module, which uses TensorRT to generate a model serialization engine; a remote sensing image target detection model image module, which builds a container image of the application and its dependencies and deploys the image on the Kubernetes edge computing cluster; and a remote sensing image target detection model execution module, which uses commands provided by the Kubernetes edge computing cluster to execute target detection. The solution of this invention enables remote sensing image target detection on an edge computing cluster, reduces data transmission and processing latency, improves deployment and operational efficiency, and supports rapid response and real-time decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent interpretation of remote sensing images, edge intelligence, and cloud-edge collaboration, and in particular to a method and system for target detection in remote sensing images based on a Kubernetes edge computing cluster. Background Technology

[0002] Remote sensing image target detection refers to the detection of the presence of targets of interest such as buildings, roads, and ships in remote sensing images, as well as information such as the type, location, and quantity of the targets. It has been widely used in military fields such as battlefield environment assessment, military target reconnaissance, and border security inspection, as well as in civilian fields such as traffic detection, agricultural environment monitoring, resource exploration, and urban planning.

[0003] In recent years, deep learning has been successfully applied in numerous fields due to its powerful ability to represent complex nonlinear features. Deep learning-based methods have achieved higher detection accuracy and have become the mainstream algorithm in the current target detection field. However, most existing deep learning-based remote sensing image target detection methods employ larger and deeper deep neural networks to enhance nonlinear fitting capabilities, resulting in a large number of parameters and computational load, placing higher demands on computing and storage resources, and typically requiring powerful computing capabilities.

[0004] In recent years, with the development of Internet and sensor technology, the number of terminal devices and edge devices and the data they generate have been increasing. Edge computing can process data on the side closer to the data source, and has advantages such as fast response speed, high real-time performance, low transmission bandwidth pressure, and high data privacy, making it an important supplement to cloud computing. Summary of the Invention

[0005] To address the aforementioned problems, this invention provides a remote sensing image target detection method based on a Kubernetes edge computing cluster, comprising:

[0006] The edge cluster building module is used to build an edge computing cluster environment that utilizes the Kubernetes container orchestration and management platform. The edge computing cluster environment includes server nodes (master nodes) and edge computing nodes (worker nodes).

[0007] Using a lightweight remote sensing image target detection model building module, an automated model pruning method based on reinforcement learning and YOLOv5 is constructed and trained to build a lightweight remote sensing image target detection model.

[0008] Using the remote sensing image target detection model inference engine module, a serialization engine is generated to convert the lightweight remote sensing image target detection model into a format that can be executed in an edge computing cluster environment using TensorRT;

[0009] Using the remote sensing image target detection model image module, a container image is built based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, and the generated image is deployed in the edge computing cluster environment.

[0010] The module runs a remote sensing image target detection model, which uses detection commands provided by the edge computing cluster environment to perform target detection on the remote sensing image to be detected.

[0011] Furthermore, the server nodes are built on AMD64 architecture computers, while the edge computing nodes are built on ARM64 architecture computers.

[0012] Furthermore, an automated model pruning algorithm based on reinforcement learning, using YOLOv5 as a foundation, is constructed to compress and obtain a lightweight remote sensing image target detection model, specifically:

[0013] The remote sensing images are used as the original dataset. The original dataset is then divided into training and validation sets.

[0014] Based on the single-stage object detection algorithm YOLOv5s, the YOLOv5s network model is trained using the training set until the YOLOv5s network model converges, thus obtaining the trained YOLOv5s network model.

[0015] Inference is performed on the validation set using the trained YOLOv5s network model. For overlapping detection boxes with different confidence levels generated by the YOLOv5s network model for the same target, non-maximum suppression (NMS) is used to process the detection results. Redundant detection boxes are filtered based on the intersection-union ratio (IU) and confidence threshold. The model accuracy is evaluated based on precision, recall, and mAP.

[0016] An automated model pruning method based on reinforcement learning is used to search for the optimal pruning rate of each layer of the trained YOLOv5s network model using reinforcement learning, and redundant channels are removed using channel pruning based on the L1 norm. The pruned model is denoted as YOLOv5s-pruned. The YOLOv5s-pruned model is fine-tuned using the training set to restore the model accuracy and obtain the final lightweight remote sensing image target detection model.

[0017] Two different pruning strategies are adopted for two different scenarios: for resource-constrained scenarios, the model accuracy is improved as much as possible while ensuring the target compression rate is met; for scenarios with high accuracy requirements, the model is compressed as much as possible while ensuring accuracy.

[0018] Furthermore, TensorRT is used to convert the lightweight remote sensing image target detection model into a format that can be executed in an edge computing cluster environment, and the serialization engine for generating the lightweight remote sensing image target detection model is as follows:

[0019] Use the torch.onnx.export function to convert a torch model to an ONNX model;

[0020] Create a Builder;

[0021] Build a Logger;

[0022] Construct the computation graph of the main network, use OnnxParser to create an ONNX parser to populate the network, parse the ONNX model into the TensorRT network, and use the NetworkDefinitionCreationFlag.EXPLICIT_BATCH flag as the construction parameter of the network.

[0023] Network parameters can be set via Builder.create_builder_config, and the maximum available video memory can be specified using max_workspace_size. INT8 model quantization can be enabled using set_flag, or FP16 model quantization can be enabled using set_flag. For INT8 model quantization, the calibrator needs to be implemented by inheriting trt.IInt8EntropyCalibrator2.

[0024] The engine is built using builder.build_engine and serialized using engine.serialize().

[0025] Inference is performed using a lightweight remote sensing image target detection model on server nodes, and inference is performed using an FP16 or INT8 model quantization and serialization engine generated by TensorRT for the lightweight remote sensing image target detection model on edge computing nodes.

[0026] Furthermore, based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, container images are built using containerization technology, and the generated images are deployed in the edge computing cluster environment, specifically:

[0027] Based on the characteristics of server nodes and edge computing nodes, install the relevant environment for object detection into the base image, create a working directory within the image, and copy the model project and serialization engine files to the working directory.

[0028] Generate a Docker image based on the Dockerfile, run the Docker image locally to create a Docker container, enter the container to execute the remote sensing image target detection model, and test the availability of the image;

[0029] Push the image to the remote repository. After successful testing, log in to the remote repository, use the relevant commands to tag the image, and push the newly generated image to the remote repository.

[0030] Write a YAML file specifying key information, including: Pod type, application name, image name, number of replicas, and Kubernetes scheduling policy, and execute the YAML file on the server node;

[0031] Kubectl sends the YAML file to the API Server, which validates the YAML file and stores the Deployment object in etcd.

[0032] The Kubernetes Controller Manager component monitors the API Server's Deployment objects and creates a specified number of Pod objects based on the replica count in the YAML file and the Pod template.

[0033] Using the default Kubernetes scheduler, the Scheduler matches the Pod resource requirements with the availability of edge computing node resources, and selects the optimal edge computing node for scheduling. When a Pod object is scheduled to an edge computing node, Kubelet creates a corresponding container according to the Pod definition and runs the container on the edge computing node. Kubelet periodically checks the container's running status and communicates with the API Server to save the scheduled edge computing node information to etcd and ensure that the actual state of the Pod object matches the expected state.

[0034] Furthermore, the workflow of the remote sensing image target detection model operation module is as follows:

[0035] Enter the command on the server node to run the target detection code in the Pod and perform the remote sensing image target detection task.

[0036] Load the model, check if the image size in the input model is a multiple of 32, if not, adjust it to a multiple of 32 and return;

[0037] Iterate through all images in the folder and store them in a dataset;

[0038] Acquire target category information from remote sensing images and set the color attribute of the corresponding target detection bounding box;

[0039] Forward inference for target detection in remote sensing images, followed by non-maximum suppression (NMS) processing;

[0040] To perform target detection on the remote sensing image to be tested, set the file path for saving the target bounding box coordinates, use annotator.box_label to draw the detection results, confidence values ​​and bounding boxes on the remote sensing image and save them, and display information such as running time, image size, number of detected categories and the detected categories.

[0041] This invention also proposes a remote sensing image target detection system based on a Kubernetes edge computing cluster, used to implement the aforementioned remote sensing image target detection method based on a Kubernetes edge computing cluster, comprising:

[0042] The edge cluster setup module is used to build edge computing cluster environments using the Kubernetes container orchestration and management platform;

[0043] The lightweight remote sensing image target detection model building module is used to build and train a lightweight remote sensing image target detection model based on the YOLOv5 single-stage target detection algorithm and automated model pruning based on reinforcement learning.

[0044] The remote sensing image target detection model inference engine module is used to convert lightweight remote sensing image target detection models into a format that can be executed in an edge computing cluster environment using TensorRT, and generate a serialization engine.

[0045] The Remote Sensing Image Target Detection Model Image Module is used to build container images based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, and deploy the generated images in the edge computing cluster environment.

[0046] The remote sensing image target detection model running module is used to perform target detection on the remote sensing image to be detected using the detection commands provided by the edge computing cluster environment.

[0047] The beneficial effects of the technical solution provided by this invention are:

[0048] This invention proposes a method and system for remote sensing image target detection based on a Kubernetes edge computing cluster. It includes: an edge cluster setup module, which utilizes the Kubernetes container orchestration and management platform to build an edge computing cluster environment, effectively utilizing the computing and storage resources of edge nodes; a lightweight remote sensing image target detection model construction module, which, based on the classic single-stage target detection algorithm YOLOv5, constructs and trains a lightweight remote sensing image target detection model using an automated model pruning method based on reinforcement learning, reducing the number of detection model parameters and computational load, and lowering the demand for computing and storage resources; a remote sensing image target detection model inference engine module, which uses TensorRT to generate a serialization engine for the remote sensing image target detection model that conforms to the device hardware characteristics, accelerating the model inference process; a remote sensing image target detection model image module, which utilizes containerization technology to build container images of the application and its dependencies, and deploys the generated images on the Kubernetes cluster, simplifying model deployment and management; and a remote sensing image target detection model execution module, which executes target detection for a given remote sensing image using detection commands provided by Kubernetes, completing remote sensing image target detection in the edge computing cluster environment. Using the solution of this invention, remote sensing image target detection can be performed on edge computing clusters, simplifying the deployment and management of deep learning-based remote sensing image target detection network models, reducing data transmission and processing latency, improving processing efficiency and real-time performance, and meeting the needs of rapid response and real-time decision-making. Attached Figure Description

[0049] Figure 1 This is a block diagram of a remote sensing image target detection method based on a Kubernetes edge computing cluster according to an embodiment of the present invention;

[0050] Figure 2 This is a diagram of the YOLOv5s network structure, which is the basic remote sensing image target detection algorithm in this embodiment of the invention.

[0051] Figure 3 This is a framework diagram of the model pruning algorithm based on reinforcement learning in an embodiment of the present invention;

[0052] Figure 4 This is a diagram of an edge computing cluster architecture based on Kubernetes, according to an embodiment of the present invention.

[0053] Figure 5 This is a flowchart illustrating the deployment process of the remote sensing image target detection model on a Kubernetes edge computing cluster according to an embodiment of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0055] A block diagram of a remote sensing image target detection method based on a Kubernetes edge computing cluster according to an embodiment of the present invention is shown below. Figure 1 ,include:

[0056] (1) Edge cluster building module: Use the Kubernetes container orchestration and management platform to build an edge computing cluster environment, including server nodes (master nodes) and edge computing nodes (worker nodes).

[0057] Prepare multiple computers with AMD64 and ARM64 architectures as nodes, with server nodes based on AMD64 architecture and edge computing nodes based on ARM64 architecture, to form a heterogeneous edge computing cluster.

[0058] Configure the basic computer environment in the edge computing cluster environment so that all computers can access each other, disable the Swap partition and host firewall, and set up time synchronization.

[0059] All computers have the same version of Docker installed. According to the official website requirements, the necessary Kubernetes components are installed on the server nodes and edge computing nodes respectively.

[0060] Create a Kubernetes cluster, initialize server nodes, execute token generation commands on the server nodes, and then execute token generation commands on the edge computing nodes to join the Kubernetes cluster.

[0061] (2) Lightweight remote sensing image target detection model construction module: Based on YOLOv5, a lightweight remote sensing image target detection model is constructed and trained using an automated model pruning method based on reinforcement learning.

[0062] Based on the classic single-stage object detector YOLOv5s, YOLOv5s consists of three parts: Backbone, Neck, and Detector. The network structure diagram is shown below. Figure 2 As shown.

[0063] The backbone is responsible for feature extraction and consists of 10 layers arranged in series. The first layer is a standard convolutional layer (CBL) with a kernel size of 6×6 and a stride of 2. This is followed by four consecutive CBL+C3 modules, where each C3 module contains 1, 2, 3, and 1 Bottleneck1 modules respectively. The last layer is an improved spatial pyramid pooling layer (SPPF). Each CBL module consists of three modules: Conv, BN, and SiLU. Each C3 module has two branches: the first is a 1×1 convolutional layer, and the second is a 1×1 convolutional layer followed by multiple Bottleneck1 modules arranged in series. The input is processed through both branches to extract features, and the results are then combined and passed through a 1×1 convolutional layer as the final output. Each Bottleneck1 module consists of a 1×1 convolutional layer, a 3×3 convolutional layer, and finally added to the initial input via a residual structure. The SPPF first obtains a feature from the input through a 1×1 convolutional layer, then passes the feature through 5×5, 9×9, and 13×13 pooling layers to obtain three features at different scales. Finally, the four features at different scales are fused and input into a 1×1 convolutional layer to obtain the final output feature map.

[0064] The Neck section uses a PAN structure, which adds a bottom-up structure to the top-down feature pyramid structure. This PAN structure retains more shallow features and improves feature extraction capabilities. This section ultimately yields three feature maps at different scales: shallow, mid-level, and deep features. The top-down section produces three different levels of feature maps. First, the output of the BackBone section is processed by a 1×1 convolutional layer with a stride of 1 to obtain the first output feature map, with a size of 32×32×512. This feature map is then upsampled by 2x and fused with the corresponding scale feature map from the BackBone section. This fusion is then passed through a C3 module and a convolutional layer to obtain the second output feature map, with a size of 64×64×256. Finally, this feature map is upsampled by 2x again and fused with the corresponding scale feature map from the BackBone section. This fusion is then passed through a C3 module to obtain the third output feature map, with a size of 128×12. The bottom-up part first uses the third output of the top-down part as the final shallow feature, with a size of 128×128×256. Then, this shallow feature is passed through a convolutional layer with a size of 3 and a stride of 2, and fused with the second output feature map of the top-down part. Then, it is passed through a C3 module to obtain the final mid-layer feature, with a size of 64×64×512. Then, this feature is passed through a convolutional layer with a stride of 2 for dimensionality reduction, and fused with the first output feature of the top-down part. Finally, it is passed through a C3 module to obtain the final deep feature, with a size of 32×32×1024.

[0065] The Detector part consists of three convolutional layers with a kernel size of 1×1 and a stride of 2, which predict features at three different scales to obtain the final prediction result.

[0066] Using the data processing tool officially released by DOTAv2.0, the remote sensing images were segmented with parameters of subsize=1024 and gap=200. The images in the dataset were divided into 1024×1024 pixels, with 200 pixels in the overlapping area. The dataset was then constructed based on this and divided into training and validation sets.

[0067] Train the basic YOLOv5s network model using the training set until the YOLOv5s network model converges, and you will get the trained YOLOv5s network model.

[0068] The trained YOLOv5s network model is used to perform inference on the validation set to obtain object detection results. The trained YOLOv5s network model may generate multiple overlapping detection boxes with different confidence levels for the same object. Non-maximum suppression (NMS) is used to process the object detection results. Redundant detection boxes are filtered based on the intersection-union ratio (IU) and confidence threshold. The object detection accuracy is evaluated based on precision, recall, and mAP (Mean Average Precision).

[0069] An automated pruning method based on reinforcement learning prunes the trained YOLOv5s network model. The pruning process is modeled as a reinforcement learning process, with the deep neural network itself as the environment and the pruning rate of each layer as the action. A reward function is constructed using parameters such as the accuracy, computational cost, and number of parameters after pruning, which serves as feedback to the environment. The agent is trained to generate the optimal pruning rate for each layer through reinforcement learning.

[0070] The reinforcement learning modeling includes three parts: state space, action space, and agent.

[0071] Taking the constraint computation as an example, the state space can be composed of 10 features from each layer of the neural network, as shown in the following expression:

[0072] s t =(l t ,n,c,h,w,stride,FLOPs[t],reduced,rest,a t-1 )

[0073] Among them, s t For the layer state space, l t `n` is the layer index, `c` is the number of input channels, `h` is the height of the input feature map, `w` is the width of the input feature map, `stride` is the stride of this layer, `FLOPs[t]` is the computational cost of this layer, `reduced` is the computational cost that has been pruned, `rest` is the remaining computational cost, and `a` is the layer index. t-1 The pruning rate of the previous layer.

[0074] The action space, i.e. the search space for the pruning rate, adopts a continuous action space a∈(0,1] to achieve finer-grained and more accurate compression.

[0075] The agent uses Deep Deterministic Policy Gradient (DDPG) to control the continuous action space and adds noise to the actions during training to achieve better search.

[0076] Specific pruning methods are as follows: Figure 3As shown, a hierarchical pruning method is adopted. For each layer, the state parameter St of that layer is first generated. The agent provides a pruning rate based on the state information and prunes the layer according to the pruning rate. The pruning method uses channel pruning based on the L1 norm. Then the agent moves to the next layer. After all layers have been pruned, the network is evaluated using a validation set, and corresponding rewards are generated and fed back to the agent. This step is repeated until the termination condition is met to train the agent to continuously search for the optimal pruning rate of each layer.

[0077] Two different search strategies are adopted for two different scenarios: for edge computing and storage resource-constrained scenarios such as spaceborne and drone-borne systems, a compression strategy that guarantees the target compression rate is used; for scenarios with high accuracy requirements, a compression strategy that guarantees accuracy is used.

[0078] The compression strategy that guarantees a high compression ratio ensures accuracy as much as possible while achieving a given target compression ratio. The target compression ratio is achieved by controlling the action space. Taking computational cost reduction as an example, if the computational cost of the pruned model is required to be below a certain value, then when pruning to each layer, it is first determined whether the pruning rate of that layer meets the requirement. That is, the remaining layers are pruned using the maximum pruning rate. Then, the computational cost after pruning is calculated. If the computational cost after pruning does not meet the target computational cost, it means that the pruning rate of that layer does not meet the requirement, and the pruning rate of that layer is increased until the requirement is met. By setting a reward function related to accuracy, the agent is continuously incentivized to optimize towards higher accuracy during the training process. The reward function is as follows:

[0079] r err =-Error

[0080] Where, r err The reward represents the improvement in accuracy, and -Error indicates the accuracy error compared to the initial model. The accuracy-guaranteed compression strategy compresses the model as much as possible while maintaining accuracy. By setting a reward function, incentives for accuracy are provided, and computational and parameter counts are included in the reward function to incentivize the reduction of model parameters and computational load. The reward function is as follows:

[0081] r FLOPs = -Error*log(FLOPs)

[0082] r Param = -Error*log(Param)

[0083] Where, r FLOPs This represents the reward for optimizing accuracy and computational cost, where FLOPs represents the computational cost after pruning, and r ParamThe reward represents the optimization of accuracy and parameter quantity. Param represents the number of parameters after pruning. The pruned YOLOv5-pruned model is fine-tuned using training set data to restore the model's detection accuracy, resulting in the final lightweight remote sensing image target detection model.

[0084] (3) Remote sensing image target detection model inference engine module, using TensorRT to generate a serialization engine, converts the lightweight remote sensing image target detection model into a format that can be executed in an edge computing cluster environment.

[0085] To ensure the interactivity of AI models, TensorRT requires converting torch models to ONNX, an open neural network exchange format that is independent of the environment and platform. The torch.onnx.export function is used to convert torch models to ONNX models.

[0086] Create a Builder, which is the entry point for model building. The TensorRT internal representation of the network and the executable engine are all generated by the member methods of this object.

[0087] Build a Logger, which is used to manage logs. Here you can select the information that needs to be recorded for each engine build step.

[0088] The computation graph of the main network is constructed. To parse the ONNX model into the TensorRT network, an ONNX parser is created using OnnxParser to populate the network. To accommodate new operators and structures in the network, the NetworkDefinitionCreationFlag.EXPLICIT_BATCH flag is used as the construction parameter of the network.

[0089] Network parameters can be set via Builder.create_builder_config, and the maximum available video memory can be specified using max_workspace_size. INT8 model quantization can be enabled using set_flag(trt.BuilderFlag.INT8), or FP16 model quantization can be enabled using set_flag(trt.BuilderFlag.FP16). For INT8 model quantization, the calibrator needs to be implemented by inheriting trt.IInt8EntropyCalibrator2.

[0090] The engine is built and serialized using builder.build_engine and serialized using engine.serialize().

[0091] TensorRT is used to generate a serialization engine that conforms to the hardware characteristics of the device. A lightweight remote sensing image target detection model is used for inference on the server node, and a lightweight remote sensing image target detection model FP16 or INT8 model quantization serialization engine generated by TensorRT is used for inference on the edge computing node.

[0092] (4) Remote sensing image target detection model image module: Based on the lightweight remote sensing image target detection model and serialization engine that can be executed in the edge computing cluster environment, container image is constructed using containerization technology, and the generated image is deployed in the edge computing cluster environment.

[0093] Write a Dockerfile. The specific steps are as follows: Based on the computer architecture and the characteristics of the graphics card, install the relevant environment for object detection into the base image, create a working directory in the image, and copy the model project and the serialization engine file that conforms to the device hardware characteristics generated in step (3) to the working directory.

[0094] Generate a Docker image based on the Dockerfile, run the Docker image locally to create a Docker container, enter the container to execute the remote sensing image target detection model, and test the availability of the image.

[0095] Push the image to the remote repository. After a successful test, log in to the remote repository, use the relevant commands to tag the image, and push the newly generated image to the remote repository.

[0096] Write a YAML file that specifies key information such as Pod type, application name, image name, number of replicas, and Kubernetes scheduling policy, and then execute the YAML file on the server node.

[0097] Kubectl sends the YAML file to the API Server. The API Server validates the YAML file and stores the Deployment object in etcd, so that the API Server can read the Deployment object from etcd and perform operations in subsequent update and delete operations.

[0098] The Kubernetes Controller Manager component monitors the API Server's Deployment objects and creates a specified number of Pod objects based on the replica count in the YAML file and the Pod template.

[0099] Figure 4This is a schematic diagram of an edge computing cluster architecture based on Kubernetes, illustrating an edge computing cluster architecture with one master node and two worker nodes. The master node (server node) is the control node of the Kubernetes cluster, responsible for managing and monitoring the entire cluster. It includes components such as API Server, Kubectl, Controller-manager, Scheduler, and etcd. The API Server provides the Kubernetes API for interacting with the cluster. The Controller Manager manages controllers such as replica sets and services within the cluster. The Scheduler schedules Pods to nodes in the cluster. etcd provides distributed key-value storage for storing cluster state information. The edge computing nodes are worker nodes in the Kubernetes cluster, used to run containerized applications. They include components such as Kubelet, ContainerRuntime, and Kube-proxy. Kubelet manages containers and Pods on the node and communicates with the master node. ContainerRuntime runs containers such as Docker. Kube-proxy handles network proxying and load balancing for Pods. A Pod on a worker node is the smallest deployable unit in Kubernetes, containing one or more containers. A Pod is an actual application instance running on a worker node; in this invention, it is an object detection model. Refer to step 4 for the model deployment of the Kubernetes cluster.

[0100] Using the default Kubernetes scheduler, the Scheduler matches the Pod resource requirements with the availability of edge computing node resources, and selects the optimal edge computing node for scheduling. When a Pod object is scheduled to an edge computing node, Kubelet creates a corresponding container according to the Pod definition and runs the container on the edge computing node. Kubelet periodically checks the container's running status and communicates with the API Server to save the scheduled node information to etcd and ensure that the actual state of the Pod object matches the expected state. Figure 5 This is a flowchart illustrating the deployment process of the remote sensing image target detection model on a Kubernetes edge computing cluster according to an embodiment of the present invention.

[0101] (5) Remote sensing image target detection model running module, which performs target detection using the detection commands provided by the edge computing cluster environment for the remote sensing image to be detected.

[0102] Enter the command on the server node to run the target detection code in the Pod and perform the remote sensing image target detection task.

[0103] Extract the output folder and input folder information, determine whether the extracted file extensions meet the requirements, and if they do not, prompt that the file extension is not in the IMG_FORMATS list. Check if the prediction results are saved in the path, and if not, create it.

[0104] Obtain the device used for inference, detect the framework used (PyTorch / TensorRT), load the model according to the framework used, check whether the image size in the input model is a multiple of 32, if not, adjust it to a multiple of 32 and return;

[0105] Iterate through all images in the folder and store them in a dataset;

[0106] Acquire target category information from remote sensing images and set the color attribute of the corresponding target detection bounding box;

[0107] Forward inference for target detection in remote sensing images, followed by non-maximum suppression (NMS) processing;

[0108] The system performs target detection on a given remote sensing image, sets the file path for saving the target bounding box coordinates, and uses annotator.box_label to draw the labels (detection results and confidence values) and bounding boxes onto the remote sensing image and save them. The platform displays information such as runtime, image size, number of detected categories, and the detected categories.

[0109] This embodiment also includes a remote sensing image target detection system based on a Kubernetes edge computing cluster, used to implement the above-mentioned remote sensing image target detection method based on a Kubernetes edge computing cluster, including:

[0110] The edge cluster setup module is used to build edge computing cluster environments using the Kubernetes container orchestration and management platform;

[0111] The lightweight remote sensing image target detection model building module is used to build and train a lightweight remote sensing image target detection model based on YOLOv5 and reinforcement learning-based model pruning.

[0112] The remote sensing image target detection model inference engine module is used to convert lightweight remote sensing image target detection models into a format that can be executed in an edge computing cluster environment using TensorRT, and generate a serialization engine.

[0113] The Remote Sensing Image Target Detection Model Image Module is used to build container images based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, and deploy the generated images in the edge computing cluster environment.

[0114] The remote sensing image target detection model running module is used to perform target detection on the remote sensing image to be detected using the detection commands provided by the edge computing cluster environment.

[0115] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for target detection in remote sensing images based on a Kubernetes edge computing cluster, characterized in that, Includes the following steps: The edge cluster building module is used to build an edge computing cluster environment that utilizes the Kubernetes container orchestration and management platform. The edge computing cluster environment includes server nodes and edge computing nodes. Using a lightweight remote sensing image target detection model building module, an automated model pruning algorithm based on reinforcement learning and YOLOv5 is constructed to compress and obtain a lightweight remote sensing image target detection model. Using the remote sensing image target detection model inference engine module, a serialization engine is generated to convert the lightweight remote sensing image target detection model into a format that can be executed in an edge computing cluster environment using TensorRT; Using the remote sensing image target detection model image module, a container image is built based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, and the generated image is deployed in the edge computing cluster environment. The remote sensing image target detection model running module performs target detection on the remote sensing image to be detected using the detection commands provided by the edge computing cluster environment; An automated model pruning algorithm based on reinforcement learning, using YOLOv5 as a foundation, is constructed to compress and obtain a lightweight remote sensing image target detection model. Specifically: The remote sensing images are used as the original dataset. The original dataset is then divided into training and validation sets. Based on the single-stage object detection algorithm YOLOv5s, the YOLOv5s network model is trained using the training set until the YOLOv5s network model converges, thus obtaining the trained YOLOv5s network model. Inference is performed on the validation set using the trained YOLOv5s network model. For overlapping detection boxes with different confidence levels generated by the YOLOv5s network model for the same target, non-maximum suppression (NMS) is used to process the detection results. Redundant detection boxes are filtered based on the intersection-union ratio (IU) and confidence threshold. The model accuracy is evaluated based on precision, recall, and mAP. An automated model pruning method based on reinforcement learning is used to search for the optimal pruning rate of each layer of the trained YOLOv5s network model using reinforcement learning, and redundant channels are removed using channel pruning based on the L1 norm. The pruned model is denoted as YOLOv5s-pruned. The YOLOv5s-pruned model is fine-tuned using the training set to restore the model accuracy and obtain the final lightweight remote sensing image target detection model. Two different pruning strategies are adopted for two different scenarios: for resource-constrained scenarios, the model accuracy is improved as much as possible while ensuring the target compression rate is met; for scenarios with high accuracy requirements, the model is compressed as much as possible while ensuring accuracy.

2. The remote sensing image target detection method based on a Kubernetes edge computing cluster according to claim 1, characterized in that, Server nodes are built on computers based on the AMD64 architecture, while edge computing nodes are built on computers based on the ARM64 architecture.

3. The remote sensing image target detection method based on a Kubernetes edge computing cluster according to claim 1, characterized in that, TensorRT is used to convert lightweight remote sensing image target detection models into a format that can be executed in an edge computing cluster environment, and the serialization engine for generating lightweight remote sensing image target detection models is as follows: Use the torch.onnx.export function to convert a torch model to an ONNX model; Create a Builder; Build a Logger; Construct the computation graph of the main network, use OnnxParser to create an ONNX parser to populate the network, parse the ONNX model into the TensorRT network, and use the NetworkDefinitionCreationFlag.EXPLICIT_BATCH flag as the construction parameter of the network. Set network parameters using Builder.create_builder_config, specify the maximum available video memory using max_workspace_size, enable INT8 model quantization using set_flag, or enable FP16 model quantization using set_flag. For INT8 model quantization, you need to inherit trt.IInt8EntropyCalibrator2 to implement the calibrator. The engine is built using builder.build_engine and serialized using engine.serialize(). Inference is performed using a lightweight remote sensing image target detection model on server nodes, and inference is performed using an FP16 or INT8 model quantization and serialization engine generated by TensorRT for the lightweight remote sensing image target detection model on edge computing nodes.

4. The remote sensing image target detection method based on a Kubernetes edge computing cluster according to claim 1, characterized in that, Based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, container images are built using containerization technology, and the generated images are deployed in the edge computing cluster environment, specifically as follows: Based on the characteristics of server nodes and edge computing nodes, install the relevant environment for object detection into the base image, create a working directory within the image, and copy the model project and serialization engine files to the working directory. Generate a Docker image based on the Dockerfile, run the Docker image locally to create a Docker container, enter the container to execute the remote sensing image target detection model, and test the availability of the image; Push the image to the remote repository. After successful testing, log in to the remote repository, use the relevant commands to tag the image, and push the newly generated image to the remote repository. Write a YAML file specifying key information, including: Pod type, application name, image name, number of replicas, and Kubernetes scheduling policy, and execute the YAML file on the server node; Kubectl sends the YAML file to the API Server, which validates the YAML file and stores the Deployment object in etcd. The Kubernetes Controller Manager component monitors the API Server's Deployment objects and creates a specified number of Pod objects based on the replica count in the YAML file and the Pod template. Using the default Kubernetes scheduler, the Scheduler matches the Pod resource requirements with the availability of edge computing node resources, and selects the optimal edge computing node for scheduling. When a Pod object is scheduled to an edge computing node, Kubelet creates a corresponding container according to the Pod definition and runs the container on the edge computing node. Kubelet periodically checks the container's running status and communicates with the API Server to save the scheduled edge computing node information to etcd and ensure that the actual state of the Pod object matches the expected state.

5. The remote sensing image target detection method based on a Kubernetes edge computing cluster according to claim 4, characterized in that, The workflow of the remote sensing image target detection model running module is as follows: Enter the command on the server node to run the target detection code in the Pod and perform the remote sensing image target detection task. Load the model, check if the image size in the input model is a multiple of 32, if not, adjust it to a multiple of 32 and return; Iterate through all images in the folder and store them in a dataset; Acquire target category information from remote sensing images and set the color attribute of the corresponding target detection bounding box; Forward inference for target detection in remote sensing images, followed by non-maximum suppression (NMS) processing; To perform target detection on the remote sensing image to be tested, set the file path for saving the target bounding box coordinates, use annotator.box_label to draw the detection results, confidence values ​​and bounding boxes on the remote sensing image and save them, and display information such as running time, image size, number of detected categories and the detected categories.

6. A remote sensing image target detection system based on a Kubernetes edge computing cluster, used to implement the remote sensing image target detection method based on a Kubernetes edge computing cluster as described in any one of claims 1-5, characterized in that, The system includes: The edge cluster setup module is used to build edge computing cluster environments using the Kubernetes container orchestration and management platform; The lightweight remote sensing image target detection model building module is used to build and train a lightweight remote sensing image target detection model based on the single-stage target detection algorithm YOLOv5 and automated model pruning based on reinforcement learning. The remote sensing image target detection model inference engine module is used to convert lightweight remote sensing image target detection models into a format that can be executed in an edge computing cluster environment using TensorRT, and generate a serialization engine. The Remote Sensing Image Target Detection Model Image Module is used to build container images based on a lightweight remote sensing image target detection model and serialization engine that can be executed in an edge computing cluster environment, and deploy the generated images in the edge computing cluster environment. The remote sensing image target detection model running module is used to perform target detection on the remote sensing image to be detected using the detection commands provided by the edge computing cluster environment; An automated model pruning algorithm based on reinforcement learning, using YOLOv5 as a foundation, is constructed to compress and obtain a lightweight remote sensing image target detection model. Specifically: The remote sensing images are used as the original dataset. The original dataset is then divided into training and validation sets. Based on the single-stage object detection algorithm YOLOv5s, the YOLOv5s network model is trained using the training set until the YOLOv5s network model converges, thus obtaining the trained YOLOv5s network model. Inference is performed on the validation set using the trained YOLOv5s network model. For overlapping detection boxes with different confidence levels generated by the YOLOv5s network model for the same target, non-maximum suppression (NMS) is used to process the detection results. Redundant detection boxes are filtered based on the intersection-union ratio (IU) and confidence threshold. The model accuracy is evaluated based on precision, recall, and mAP. An automated model pruning method based on reinforcement learning is used to search for the optimal pruning rate of each layer of the trained YOLOv5s network model using reinforcement learning, and redundant channels are removed using channel pruning based on the L1 norm. The pruned model is denoted as YOLOv5s-pruned. The YOLOv5s-pruned model is fine-tuned using the training set to restore the model accuracy and obtain the final lightweight remote sensing image target detection model. Two different pruning strategies are adopted for two different scenarios: for resource-constrained scenarios, the model accuracy is improved as much as possible while ensuring the target compression rate is met; for scenarios with high accuracy requirements, the model is compressed as much as possible while ensuring accuracy.

Citation Information

Patent Citations

  • Remote sensing image target detection method based on deep evolution pruning convolutional network

    CN110532859A

  • SAR image ship detection method and system based on lightweight deep learning

    CN113469073A