Cross-platform lightweight model rotation target identification system for full-link model deployment
By building a task-oriented decoupled knowledge distillation framework for lightweight student models and complex teacher models, combined with ONNX intermediate representation and model quantization, the deployment problem of rotation target recognition technology on the embedded edge computing platform is solved, and efficient and cross-platform rotation target recognition is achieved.
Patent Information
- Application Number
- CN202411782258.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The existing rotating target recognition technology is difficult to deploy on embedded edge computing platforms with resource-constrained and power-sensitive embedded edge computing platforms, lightweight models cannot perform high-precision detection, and cross-platform deployment has problems such as increasing model parameters and calculation volume, inaccurate accuracy alignment, and complex deployment processes.
Build a lightweight student model and a complex teacher model, adopt a task-oriented decoupled knowledge distillation framework, and realize cross-platform precision alignment and fixed-point compression through ONNX intermediate representation and model quantization, and use container technology to integrate it into a visual real-time inference system to optimize the model deployment process.
It realizes lightweight rotation target recognition that operates efficiently on resource-constrained platforms, reduces computing resource overhead, ensures consistency and accuracy of cross-platform inference, and simplifies the model deployment process.
Smart Images

Figure CN119741471A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lightweight rotating target detection and recognition, and in particular to a cross-platform lightweight model rotating target recognition system deployed with a full-link model. Background Art
[0002] At present, efficient real-time rotating target recognition technology has been widely used in various terminal devices such as satellite and vehicle-mounted. Although existing detection technologies rely on complex network structures to enhance feature extraction and scene adaptation capabilities, this approach leads to a significant increase in model parameters and computational complexity, making these high-performance complex models unsuitable for resource-constrained and power-sensitive embedded edge computing platforms. In addition, although specially designed lightweight network models have advantages in inference speed and model simplicity, they are usually unable to perform high-precision detection tasks. Therefore, it is particularly important to bridge the performance gap between lightweight models and complex models. However, most current knowledge distillation methods fail to effectively transfer directional knowledge, and existing algorithms couple task knowledge transfer with the knowledge distillation process, which limits the effectiveness of student models in acquiring soft knowledge related to specific subtasks.
[0003] On the other hand, most algorithms show excellent performance in the preset development environment, but under the requirements of limited computing resources and high-performance intelligent detection, the deployment of lightweight models faces many challenges, especially in the inability to quickly adapt to cross-inference frameworks to meet the needs of large-scale applications. At present, most inference frameworks include their own precision alignment tools. The main purpose of these tools is to ensure the high-precision consistency of the model from the intermediate representation to the final output within the framework. However, when generating input tensors for comparison, most precision alignment tools often only consider the morphological information of the operator nodes, ignore the distribution and range of the actual input data, and often generate random tensors based on the operator shape as input, which may cause the data distribution of the input tensor to be inconsistent with the actual situation, thereby affecting the accuracy evaluation of precision alignment. In addition, the existing model deployment process is extremely complex between multiple computing platforms and inference frameworks, which not only hinders the widespread application of intelligent models, but also makes it difficult to optimize a single link due to the tight coupling of each link in the model deployment and the lack of clear division. In addition, due to the differences in optimization strategies between different inference frameworks, the consistency of cross-platform inference is difficult to ensure, which further increases the difficulty of cross-end deployment of intelligent models.
[0004] To summarize the above problems, it can be seen that for the cross-platform lightweight rotation model recognition system, it is necessary to consider many aspects such as lightweight model knowledge compensation, decoupled knowledge distillation strategy, optimized model deployment process, cross-end precision alignment, etc., and it is necessary to make major improvements to the reasoning efficiency and reasoning accuracy of the lightweight model edge platform. Summary of the invention
[0005] The present invention proposes a cross-platform lightweight model rotation target recognition system with full-link model deployment, aiming to meet the strict requirements of actual application scenarios for computing resources, and carefully divides and clarifies various stages such as intelligent model training and hardware deployment; it comprehensively introduces knowledge distillation and model post-training technology, which reduces the number of neural network parameters and reduces computing resource overhead.
[0006] The present invention adopts the following technical solutions.
[0007] The cross-platform lightweight model rotation target recognition system with full-link model deployment includes the following steps:
[0008] Step S1: Construct a lightweight student model and a complex teacher model, build a task-oriented decoupled knowledge distillation framework, and explicitly transfer the prior knowledge of each subtask to the student model;
[0009] Step S2: Use ONNX to convert the lightweight student model from the training format model to the platform-independent intermediate representation, build a cross-platform precision alignment framework, align the intermediate representation with the model weights and intermediate activations of the framework to be applied;
[0010] Step S3: Use model quantization to complete the fixed-point compression of the lightweight model, convert some floating-point calculations to fixed-point calculations, use container technology to integrate multiple inference platforms into a visual real-time inference system, and complete the deployment of a cross-platform lightweight model rotation target recognition system.
[0011] In step S1, a lightweight student network and a complex teacher network model are constructed by collecting an easily accessible multimodal image target detection dataset, and then a task-oriented knowledge distillation framework is constructed to realize knowledge transfer between models, including four subtasks: classification, positioning, angle, and label assignment. Specifically, multi-task distillation and neural network search are first used to optimize the model structure and alignment mechanism, and a two-stage training strategy is used, first independent training and then joint optimization, to enhance the performance of the student model.
[0012] Then, the lightweight student model after joint training is exported using the ONNX intermediate format, a cross-platform precision alignment framework is built, and weight alignment and intermediate activation alignment are performed to ensure the reasoning consistency of the model in the target reasoning platform and reasoning framework;
[0013] Finally, container technology is used to store model weights in different precision formats of multiple inference platforms in containers, and the visualization system is run on the specified platform to provide users with an interactive interface for selecting the inference framework and precision.
[0014] In step S1, the student model and the teacher model form a task-oriented decoupled knowledge distillation framework, and the main members thereof input data. In the complex teacher model and the lightweight student model, the input data is a large amount of resource-rich multimodal image target detection dataset collected as the basis for model training. The teacher model is a high-performance, high-precision complex model with a deep network layer and a wide network width, as well as features with multiple parameters and high computational complexity, which are used to provide rich feature representations and soft labels during the training process, and guide the student model to learn more effective feature representations and decision boundaries; during learning, the student model constructs a shallow network structure and a narrow network width by adjusting the depth factor and the width factor, and ensures that it can run efficiently on resource-constrained and power-sensitive embedded edge computing platforms by reducing the number of parameters;
[0015] The task-oriented distillation framework will present different topological relationships in the training stage and the inference stage. The topological relationship in the training stage is as follows: Fully supervised training is the first stage of the training stage. The student model and the teacher model are trained separately without joint training. The real rotated target labels and various data enhancement techniques are mainly used to allow the two models to learn basic feature representations and task capabilities. Joint training is the second stage of the training stage. The teacher model trained in the first stage is mainly used. At this time, its weights are frozen to guide the student model to conduct joint training. Under the guidance of the teacher model, the student model explicitly learns the prior knowledge of each subtask through task decoupling to improve its own performance. In the inference stage, only lightweight student models are deployed, and the teacher model does not participate in inference to ensure the efficiency and resource conservation of the system. The student model is converted into an ONNX intermediate representation, and after model quantization and cross-platform precision alignment, it is used to be deployed on the target hardware platform to achieve efficient cross-platform inference.
[0016] The core function of the data interaction interface between the student model and the teacher model is to focus on the joint training part in the training phase. The joint training uses the soft label distillation method, and uses the output probability distribution of the teacher model in the form of soft labels as the learning target of the student model; in the overall interaction process, the output of the teacher model is converted into a soft probability distribution through the Softmax function with a temperature parameter; the output of the student model is also softened, and the Kullback-Leibler divergence, that is, KL divergence, between the two is calculated as the loss term. The automatic differentiation mechanism is used in the training framework to calculate the gradient and update the weight of the student model; task decoupling distillation rotation target detection task is decoupled into the following four subtasks, and knowledge distillation is performed separately. Specifically, for classification tasks, the framework combines cross entropy loss with KL divergence; the classification probability distribution of the student model is made close to that of the teacher model, and the data interface used is the probability distribution of the classification output tensor; for positioning tasks, the training framework uses distributed focal loss DFL to model regression prediction as a probability distribution, and uses KL divergence to align the positioning probability distributions of the student model and the teacher model to improve the bounding box regression ability of the student model. The data interface used is the discrete probability distribution tensor output by the positioning branch; for angle prediction tasks, the training framework uses circular smooth labels to convert angle prediction into a classification problem, and improves the student model's ability to accurately predict the rotation angle of the target by combining cross entropy loss and KL divergence. The data interface used is the probability distribution tensor of the angle classification output; for label assignment tasks, the training framework calculates the dynamic alignment score of each anchor point, obtains the probability distribution through Softmax normalization, and uses KL divergence to align the probability distribution of anchor point assignment to make the anchor point assignment strategy of the student model consistent with that of the teacher model. The data interface used is the probability distribution tensor of the dynamic alignment score.
[0017] In step S1, the subtasks are uniformly detected, and the prediction head is soft distribution regression and task-oriented decoupled knowledge distillation: a lightweight student model and a complex teacher model are constructed, and the teacher model is used to decouple and transfer the prior knowledge of identifying each subtask to the student model, including the following steps;
[0018] Step S11: collect easily accessible rich modality image target detection datasets for building lightweight student network and complex teacher network models; the baseline network uses the Efficient-Rep series, and the neck network uses FPN and PANet; the localization branch of the prediction network adopts the anchor-free FCOS idea to predict four position offsets l, t, r, b, and applies the distribution focus loss to convert the Dirac distribution of the box into a probability distribution; in addition, the localization branch uses circular smooth labels to convert angle predictions into classification predictions, and the paradigm of the unified subtask head is to predict soft distribution;
[0019] Step S12: Use neural network search to adjust the model structure, and adjust the number of convolution blocks and network width by controlling the depth factor and width factor; the depth and width factors of the teacher model are both 1, and the depth and width of the lightweight student model are set to 0.33 and 0.50 respectively to meet the performance differences and inference speed requirements of edge devices; Step S13: Construct a rotation box task alignment allocation mechanism to coordinate the classification confidence, regression quality, and angle prediction of anchor point prediction. Specifically, in the label allocation process, for the prediction of each anchor point, a multi-task alignment score is calculated, which consists of three parts: classification confidence c, angle classification confidence w, and regression quality μ; by using s to represent this weighted number, it can be expressed as: S = c α ×μ β × γ
[0020]
[0021] Where s represents the classification score of the multi-task decoupling head, where the classification score is the highest classification score among the anchor points, representing the overall classification confidence; μ represents the generalized intersection-over-union score of the rotation target predicted by the multi-task decoupling head of the anchor point and the ground truth box GT, and m represents the highest confidence value of the rotation angle classification head, representing the overall angle confidence;
[0022] The overall process of the algorithm is as follows: suppose that each anchor point in the input feature map predicts the category score s, positioning score μ, and angle score m of the rotation box. First, predict the category score, positioning score, and angle score of the rotation box for each anchor point. Then, calculate the alignment score of each feature map grid point, and then check whether each anchor point is located inside its corresponding rotation box. If not, mark it as a negative sample. For anchor points that are still positive samples, select the first K as positive samples according to the size of the alignment score. Finally, normalize the alignment scores of these positive samples for subsequent loss function calculations.
[0023] Step S14: Using the rotation task alignment assignment and the specified modality rotation target detection dataset collected in step S11, a two-stage training strategy is adopted; in the first stage, the fully supervised student network and the teacher network are trained independently, using only the rotation target labels of step S11, and no joint training is performed;
[0024] Step S15: Construct a task-oriented decoupled knowledge distillation framework to achieve efficient knowledge transfer from complex high-performance models to lightweight models by explicitly decomposing the four subtasks of target classification, position regression, direction rotation and label assignment; the framework uses the pre-trained weights in the first stage as the initial weights of the teacher network, and in the second stage, through a joint training strategy, uses the logistic regression output of the teacher network for training, and utilizes the teacher network in four tasks, namely: classification, positioning, label assignment and soft distribution knowledge of angles.
[0025] In step S15, for the classification task, the output labels of the teacher model and the student model are expressed as These output labels are converted into probability distributions by using the Softmax function with a temperature parameter τ and In this process, the student model needs to minimize the loss functions including binary cross entropy (BCE) and Kullback-Leibler (KL) divergence to improve the accuracy and consistency of prediction; in the process of knowledge distillation, only the weight parameters of the student model are updated, and the weight of the teacher model is kept unchanged to ensure the stability of training, which can be expressed as:
[0026]
[0027] For the positioning task, the four outputs (l, t, r, b) of the regression prediction are modeled as general probability distributions and converted into discrete probability distributions through the DFL detection head. The output of the positioning branch is aligned with the classification branch before decoding, allowing the knowledge distillation method to be extended from image classification to positioning prediction, improving the model's ability to recognize the location of objects in the environment; the student model and the teacher model have the same bounding box The DFL soft labels predicted by the four variables are S reg and T reg ;pass S oftmax converted to probability distribution and The Kullback-Leibler (KL) divergence is used to evaluate the similarity between two distributions, which is expressed as:
[0028]
[0029] In the angle task, the Softmax function with a temperature parameter is used to soften the output distribution of the teacher and student models, making the probability distribution more informative; the student model is allowed to improve the detection accuracy by jointly learning the teacher model and the true label; in the angle distillation, the direction branch output of the student model and the teacher model, namely the angle soft label, is used Indicates; θ classrepresents the number of angle classifications, which is set to 180°, while W and H represent the width and height of the detection head branch in the predicted feature map, respectively. The formula is:
[0030]
[0031]
[0032] In this setup, θ class represents a circular smooth label, and L CE and L KL Refers to the cross entropy loss and KL divergence respectively. θ is the coefficient used to reconcile the two losses, and the distillation process is only performed on the positive sample regions selected from the label distribution;
[0033] The label assignment task achieves spatial alignment by reducing the difference in the distribution of dynamic alignment metric scores between the two models at the instance level; the label assignment distillation method uses the dynamic alignment coefficient distribution of each anchor point in a single truth box as a benchmark, and aligns by forcibly constraining these distributions of the teacher and student models to enhance the consistency between the soft labels of the teacher model and the true labels during training, and improve the accuracy and robustness of the model in practical applications; it can be expressed as:
[0034]
[0035] For a specific instance at position j, the total number of anchor points in the ground truth box of the instance is defined as N j ; For the i-th anchor point of this instance, the alignment score of the student model is expressed as The alignment score of the teacher model for the same anchor point is expressed as In order to solve the consistency problem of alignment distribution, the Softmax function is used to normalize the dynamic alignment scores of all anchor points in the instance to obtain the probability distribution of label assignment. These normalized scores are defined as and Mask-Softmax is adopted to exclude the interference of anchor point assignment outside the ground truth box, and the impact of instance size and dynamic alignment score on the results is alleviated by implementing a normalization process. By minimizing the KL divergence of the label assignment distribution between the teacher model and the student model, the loss function is defined as:
[0036]
[0037] When performing multi-task knowledge distillation, four parts are involved: position regression, category classification, angle positioning, and label assignment distillation. Specifically, in the early stages of training, the student model is more likely to receive and learn soft labels from the teacher model. As the training progresses, the performance of the student model gradually approaches that of the teacher model, and the help from the supervision constraints becomes more significant. In this process, the training strategy of the second stage emphasizes joint training, in which the weights of the student model are derived from the model trained in full supervision in the first stage. This stage also introduces stronger data enhancement techniques to further improve the generalization ability of the model. At the same time, the weights of the teacher model are frozen in the second stage of training to ensure its stability and focus on guiding the learning of the student model.
[0038] Step S2 comprises the following steps:
[0039] Step S21, export the lightweight student model after the joint training in S15 using the ONNX intermediate format, and convert the lightweight student model into an intermediate expression independent of the hardware platform;
[0040] Step S22, weight alignment is performed on the intermediate expression obtained in S21, and a recursive query is performed directly according to the initialization weight of the intermediate expression of the model to query the absolute number and relative number of weight tensors of a certain operator that exceed the representation range. At the same time, the weight distribution is used to evaluate the representation quality of the weight tensors of different operators in a specific data format, and the maximum representation accuracy of some operators is adjusted according to the actual position of some operators;
[0041] Step S23, determine the target inference platform and framework to ensure that the model is correctly executed in full-precision and half-precision inference formats; this step focuses on the intermediate activation tensors generated by the model during the inference process to ensure activation alignment between multiple platforms; as a benchmark framework, ONNXRuntime is selected as the main inference engine, and the output level of all models uses FP32 precision to reduce the accuracy difference between the deployment and training models; ONNX extracts the necessary intermediate tensor outputs at multiple subdivision levels by setting input and output nodes of different granularities, and provides three granularity options: output all nodes, specify input and output operator nodes, and specify operator node types;
[0042] Subsequently, the framework converts the adjusted ONNX model to adapt to different inference frameworks and converts it into an executable format for the target platform. In terms of data input, the benchmark framework pre-calculates and stores the tensor data of all output nodes. During the alignment process, the system automatically assigns the pre-stored input tensors to the framework to be aligned according to the input node name, and identifies the problematic operator nodes by comparing the outputs of the benchmark and inference frameworks layer by layer. The alignment baseline framework automatically performs model shape inference, automatically generates input tensors for the framework to be aligned and the benchmark, and ensures correctness by comparing the output tensors layer by layer.
[0043] By using the full node output or the coarse-grained method by operator type, the scope or type of operators that may have precision problems can be quickly located. After the potential problem operator is identified, it is switched to a finer granularity level - directly specifying the operator name for detailed analysis and inspection to avoid manually specifying a large number of operator names in the early stages. The problem scope can be quickly narrowed down through coarser granularity to effectively reduce the debugging workload; through fine third-level granularity positioning, accurate diagnosis and resolution of the problem operator can be ensured to avoid misdiagnosis and omissions;
[0044] After exporting the intermediate output operators, the new ONNX model will be directly connected to each target inference engine for model conversion; the alignment framework runs reasoning based on the aforementioned input method and compares the tensor output of each intermediate output node layer by layer; if a difference is detected, the framework will identify and report the location and name of the problematic operator; the cross-platform alignment method of intermediate activation tensors is used to effectively identify and resolve potential accuracy issues, ensuring consistent performance of lightweight models in different inference environments.
[0045] Step S3 comprises the following steps:
[0046] Step S31: Determine multiple inference platforms to be deployed, pre-install all dependent files and the intermediate representation file after precision alignment in step S23, and pre-use the intermediate representation to complete the calibration table of low-precision quantization in the development platform, use real data to input into the intermediate representation, obtain the histogram distribution data of most tensors, and package the above three files into a container to reduce the difficulty of reproducing the deployment environment;
[0047] Step S32: According to different computing platforms, the container of step S31 is deployed to the specified platform, and the model quantization tool chain of the corresponding reasoning framework is called by using the intermediate representation, calibration set and other dependent files to generate model weights in three reasoning formats: FP32, FP16 and INT8. According to the hardware structure characteristics of the platform, the reasoning platform is used to perform automatic reasoning optimization, and the weights of different precision formats of multiple reasoning platforms are stored in the container;
[0048] Step S33: Run the service on the designated platform to access the visualization system.
[0049] In step S33, the designated platform includes Nvidia Xavier, and the visual intelligent system uses Gradio front-end interaction to reduce environmental dependence. The user first selects a supported reasoning framework through a drop-down menu. After selection, another drop-down menu will automatically update the model weight accuracy options according to the reasoning format and accuracy supported by the current system; if the selected format is not supported in the current system, the system will prompt the user to reselect and display the unsupported reasoning format information;
[0050] For different access forms, if it is on the embedded side, the current hardware is automatically detected, and the written C++ real-time reasoning logic is used for dynamic binding to complete efficient reasoning; if it is on the Web side, FastAPI is used to provide backend services.
[0051] After the user selects the inference framework and precision, the system automatically preloads the corresponding model and data, calls the necessary inference runtime library and hardware resources including GPU for efficient model inference, and displays the results on the front-end interface; the interface displays the currently loaded weight file and updates the status in real time when the selected weight is not supported; users can upload original images for testing. After uploading, the image will be parsed and visualized, and the results will be displayed in the output image box. Users can also download the coordinate position of the object and its visualization image.
[0052] When the cross-platform lightweight model rotating target recognition system is used for satellites, preliminary data processing and target recognition are completed on the satellite side; that is, the student model optimized by knowledge distillation is run on the satellite platform to achieve efficient rotating target detection, and at the same time, the model deployment process is simplified by using ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform;
[0053] The cross-platform lightweight model rotating target recognition system is used to process data in real time during the flight of a drone to ensure the timeliness of the task. It uses a lightweight student model at the drone body to reduce the computing and energy consumption burden, and can be quickly deployed on different types of drone platforms through the full-link model deployment of the drone.
[0054] The present invention discloses a cross-platform lightweight model rotation target recognition system based on full-link model deployment, which includes constructing a lightweight student model and a complex teacher model neural network of uniform distribution regression, constructing a rotation task alignment allocation mechanism to optimize the supervised training process, and constructing a task-oriented decoupled knowledge distillation framework to deeply compress the lightweight model. ONNX is used to convert the lightweight student model from the training format model to a platform-independent intermediate representation, and a cross-platform precision alignment framework is constructed to align the intermediate representation with the model weight and intermediate activation of the framework to be applied. The fixed-point compression of the lightweight model is completed by model quantization, part of the floating-point calculation is converted to fixed-point calculation, and multiple reasoning platforms are uniformly integrated into a visual real-time reasoning system using container technology to complete the three steps of full-link deployment of the cross-platform lightweight model rotation target recognition system. The present invention proposes a full-link model deployment method that focuses on meeting the strict requirements of actual application scenarios for computing resources, and carefully divides and clarifies the various stages of intelligent model training and hardware deployment; knowledge distillation and model post-training technology are fully introduced to simplify the number of neural network parameters and reduce computing resource overhead. The system hides the complex deployment details of multiple platforms, allowing users to easily test the current rotating object detection model across platforms and frameworks. The interface and platform design significantly reduces the difficulty of algorithm application. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0056] Attached Figure 1 It is a schematic diagram of the process of the present invention;
[0057] Attached Figure 2 It is a schematic diagram of the principles of lightweight student network and complex teacher network model. DETAILED DESCRIPTION
[0058] As shown in the figure, the cross-platform lightweight model rotation target recognition system with full-link model deployment includes the following steps:
[0059] Step S1: Construct a lightweight student model and a complex teacher model, build a task-oriented decoupled knowledge distillation framework, and explicitly transfer the prior knowledge of each subtask to the student model;
[0060] Step S2: Use ONNX to convert the lightweight student model from the training format model to the platform-independent intermediate representation, build a cross-platform precision alignment framework, align the intermediate representation with the model weights and intermediate activations of the framework to be applied;
[0061] Step S3: Use model quantization to complete the fixed-point compression of the lightweight model, convert some floating-point calculations to fixed-point calculations, use container technology to integrate multiple inference platforms into a visual real-time inference system, and complete the deployment of a cross-platform lightweight model rotation target recognition system.
[0062] In step S1, a lightweight student network and a complex teacher network model are constructed by collecting an easily accessible multimodal image target detection dataset, and then a task-oriented knowledge distillation framework is constructed to realize knowledge transfer between models, including four subtasks: classification, positioning, angle, and label assignment. Specifically, multi-task distillation and neural network search are first used to optimize the model structure and alignment mechanism, and a two-stage training strategy is used, first independent training and then joint optimization, to enhance the performance of the student model.
[0063] Then, the lightweight student model after joint training is exported using the ONNX intermediate format, a cross-platform precision alignment framework is built, and weight alignment and intermediate activation alignment are performed to ensure the reasoning consistency of the model in the target reasoning platform and reasoning framework;
[0064] Finally, container technology is used to store model weights in different precision formats of multiple inference platforms in containers, and the visualization system is run on the specified platform to provide users with an interactive interface for selecting the inference framework and precision.
[0065] In step S1, the student model and the teacher model form a task-oriented decoupled knowledge distillation framework, and the main members thereof input data. In the complex teacher model and the lightweight student model, the input data is a large amount of resource-rich multimodal image target detection dataset collected as the basis for model training. The teacher model is a high-performance, high-precision complex model with a deep network layer and a wide network width, as well as features with multiple parameters and high computational complexity, which are used to provide rich feature representations and soft labels during the training process, and guide the student model to learn more effective feature representations and decision boundaries; during learning, the student model constructs a shallow network structure and a narrow network width by adjusting the depth factor and the width factor, and ensures that it can run efficiently on resource-constrained and power-sensitive embedded edge computing platforms by reducing the number of parameters;
[0066] The task-oriented distillation framework will present different topological relationships in the training stage and the inference stage. The topological relationship in the training stage is as follows: Fully supervised training is the first stage of the training stage. The student model and the teacher model are trained separately without joint training. The real rotated target labels and various data enhancement techniques are mainly used to allow the two models to learn basic feature representations and task capabilities. Joint training is the second stage of the training stage. The teacher model trained in the first stage is mainly used. At this time, its weights are frozen to guide the student model to conduct joint training. Under the guidance of the teacher model, the student model explicitly learns the prior knowledge of each subtask through task decoupling to improve its own performance. In the inference stage, only lightweight student models are deployed, and the teacher model does not participate in inference to ensure the efficiency and resource conservation of the system. The student model is converted into an ONNX intermediate representation, and after model quantization and cross-platform precision alignment, it is used to be deployed on the target hardware platform to achieve efficient cross-platform inference.
[0067] The core function of the data interaction interface between the student model and the teacher model is to focus on the joint training part in the training phase. The joint training uses the soft label distillation method, and uses the output probability distribution of the teacher model in the form of soft labels as the learning target of the student model; in the overall interaction process, the output of the teacher model is converted into a soft probability distribution through the Softmax function with a temperature parameter; the output of the student model is also softened, and the Kullback-Leibler divergence, that is, KL divergence, between the two is calculated as the loss term. The automatic differentiation mechanism is used in the training framework to calculate the gradient and update the weight of the student model; task decoupling distillation rotation target detection task is decoupled into the following four subtasks, and knowledge distillation is performed separately. Specifically, for classification tasks, the framework combines cross entropy loss with KL divergence; the classification probability distribution of the student model is made close to that of the teacher model, and the data interface used is the probability distribution of the classification output tensor; for positioning tasks, the training framework uses distributed focal loss DFL to model regression prediction as a probability distribution, and uses KL divergence to align the positioning probability distributions of the student model and the teacher model to improve the bounding box regression ability of the student model. The data interface used is the discrete probability distribution tensor output by the positioning branch; for angle prediction tasks, the training framework uses circular smooth labels to convert angle prediction into a classification problem, and improves the student model's ability to accurately predict the rotation angle of the target by combining cross entropy loss and KL divergence. The data interface used is the probability distribution tensor of the angle classification output; for label assignment tasks, the training framework calculates the dynamic alignment score of each anchor point, obtains the probability distribution through Softmax normalization, and uses KL divergence to align the probability distribution of anchor point assignment to make the anchor point assignment strategy of the student model consistent with that of the teacher model. The data interface used is the probability distribution tensor of the dynamic alignment score.
[0068] In step S1, the subtasks are uniformly detected, and the prediction head is soft distribution regression and task-oriented decoupled knowledge distillation: a lightweight student model and a complex teacher model are constructed, and the teacher model is used to decouple and transfer the prior knowledge of identifying each subtask to the student model, including the following steps;
[0069] Step S11: collect easily accessible rich modality image target detection datasets for building lightweight student network and complex teacher network models; the baseline network uses the Efficient-Rep series, and the neck network uses FPN and PANet; the localization branch of the prediction network adopts the anchor-free FCOS idea to predict four position offsets l, t, r, b, and applies the distribution focus loss to convert the Dirac distribution of the box into a probability distribution; in addition, the localization branch uses circular smooth labels to convert angle predictions into classification predictions, and the paradigm of the unified subtask head is to predict soft distribution;
[0070] Step S12: Use neural network search to adjust the model structure, and adjust the number of convolution blocks and network width by controlling the depth factor and width factor; the depth and width factors of the teacher model are both 1, and the depth and width of the lightweight student model are set to 0.33 and 0.50 respectively to meet the performance differences and inference speed requirements of edge devices; Step S13: Construct a rotation box task alignment allocation mechanism to coordinate the classification confidence, regression quality, and angle prediction of anchor point prediction. Specifically, in the label allocation process, for the prediction of each anchor point, a multi-task alignment score is calculated, which consists of three parts: classification confidence c, angle classification confidence w, and regression quality μ; by using s to represent this weighted number, it can be expressed as: S = c α ×μ β × γ
[0071]
[0072] Where s represents the classification score of the multi-task decoupling head, where the classification score is the highest classification score among the anchor points, representing the overall classification confidence; μ represents the generalized intersection-over-union score of the rotation target predicted by the multi-task decoupling head of the anchor point and the ground truth box GT, and m represents the highest confidence value of the rotation angle classification head, representing the overall angle confidence;
[0073] The overall process of the algorithm is as follows: suppose that each anchor point in the input feature map predicts the category score s, positioning score μ, and angle score m of the rotation box. First, predict the category score, positioning score, and angle score of the rotation box for each anchor point. Then, calculate the alignment score of each feature map grid point, and then check whether each anchor point is located inside its corresponding rotation box. If not, mark it as a negative sample. For anchor points that are still positive samples, select the first K as positive samples according to the size of the alignment score. Finally, normalize the alignment scores of these positive samples for subsequent loss function calculations.
[0074] Step S14: Using the rotation task alignment assignment and the specified modality rotation target detection dataset collected in step S11, a two-stage training strategy is adopted; in the first stage, the fully supervised student network and the teacher network are trained independently, using only the rotation target labels of step S11, and no joint training is performed;
[0075] Step S15: Construct a task-oriented decoupled knowledge distillation framework to achieve efficient knowledge transfer from complex high-performance models to lightweight models by explicitly decomposing the four subtasks of target classification, position regression, direction rotation and label assignment; the framework uses the pre-trained weights in the first stage as the initial weights of the teacher network, and in the second stage, through a joint training strategy, uses the logistic regression output of the teacher network for training, and utilizes the teacher network in four tasks, namely: classification, positioning, label assignment and soft distribution knowledge of angles.
[0076] In step S15, for the classification task, the output labels of the teacher model and the student model are expressed as These output labels are converted into probability distributions by using the Softmax function with a temperature parameter τ and In this process, the student model needs to minimize the loss functions including binary cross entropy (BCE) and Kullback-Leibler (KL) divergence to improve the accuracy and consistency of prediction; in the process of knowledge distillation, only the weight parameters of the student model are updated, and the weight of the teacher model is kept unchanged to ensure the stability of training, which can be expressed as:
[0077]
[0078] For the positioning task, the four outputs (l, t, r, b) of the regression prediction are modeled as general probability distributions and converted into discrete probability distributions through the DFL detection head. The output of the positioning branch is aligned with the classification branch before decoding, allowing the knowledge distillation method to be extended from image classification to positioning prediction, improving the model's ability to recognize the location of objects in the environment; the student model and the teacher model have the same bounding box The DFL soft labels predicted by the four variables are S reg and T reg ;pass S oftmax converted to probability distribution and The Kullback-Leibler (KL) divergence is used to evaluate the similarity between two distributions, which is expressed as:
[0079]
[0080] In the angle task, the Softmax function with a temperature parameter is used to soften the output distribution of the teacher and student models, making the probability distribution more informative; the student model is allowed to improve the detection accuracy by jointly learning the teacher model and the true label; in the angle distillation, the direction branch output of the student model and the teacher model, namely the angle soft label, is used Indicates; θ class represents the number of angle classifications, which is set to 180°, while W and H represent the width and height of the detection head branch in the predicted feature map, respectively. The formula is:
[0081]
[0082]
[0083] In this setup, θ class represents a circular smooth label, and L CE and L KL Refers to the cross entropy loss and KL divergence respectively. θ is the coefficient used to reconcile the two losses, and the distillation process is only performed on the positive sample regions selected from the label distribution;
[0084] The label assignment task achieves spatial alignment by reducing the difference in the distribution of dynamic alignment metric scores between the two models at the instance level; the label assignment distillation method uses the dynamic alignment coefficient distribution of each anchor point in a single truth box as a benchmark, and aligns by forcibly constraining these distributions of the teacher and student models to enhance the consistency between the soft labels of the teacher model and the true labels during training, and improve the accuracy and robustness of the model in practical applications; it can be expressed as:
[0085]
[0086] For a specific instance at position j, the total number of anchor points in the ground truth box of the instance is defined as N j ; For the i-th anchor point of this instance, the alignment score of the student model is expressed as The alignment score of the teacher model for the same anchor point is expressed as In order to solve the consistency problem of alignment distribution, the Softmax function is used to normalize the dynamic alignment scores of all anchor points in the instance to obtain the probability distribution of label assignment. These normalized scores are defined as and Mask-Softmax is adopted to exclude the interference of anchor point assignment outside the ground truth box, and the impact of instance size and dynamic alignment score on the results is alleviated by implementing a normalization process. By minimizing the KL divergence of the label assignment distribution between the teacher model and the student model, the loss function is defined as:
[0087]
[0088] When performing multi-task knowledge distillation, four parts are involved: position regression, category classification, angle positioning, and label assignment distillation. Specifically, in the early stages of training, the student model is more likely to receive and learn soft labels from the teacher model. As the training progresses, the performance of the student model gradually approaches that of the teacher model, and the help from the supervision constraints becomes more significant. In this process, the training strategy of the second stage emphasizes joint training, in which the weights of the student model are derived from the model trained in full supervision in the first stage. This stage also introduces stronger data enhancement techniques to further improve the generalization ability of the model. At the same time, the weights of the teacher model are frozen in the second stage of training to ensure its stability and focus on guiding the learning of the student model.
[0089] Step S2 comprises the following steps:
[0090] Step S21, export the lightweight student model after the joint training in S15 using the ONNX intermediate format, and convert the lightweight student model into an intermediate expression independent of the hardware platform;
[0091] Step S22, weight alignment is performed on the intermediate expression obtained in S21, and a recursive query is performed directly according to the initialization weight of the intermediate expression of the model to query the absolute number and relative number of weight tensors of a certain operator that exceed the representation range. At the same time, the weight distribution is used to evaluate the representation quality of the weight tensors of different operators in a specific data format, and the maximum representation accuracy of some operators is adjusted according to the actual position of some operators;
[0092] Step S23, determine the target inference platform and framework to ensure that the model is correctly executed in full-precision and half-precision inference formats; this step focuses on the intermediate activation tensors generated by the model during the inference process to ensure activation alignment between multiple platforms; as a benchmark framework, ONNXRuntime is selected as the main inference engine, and the output level of all models uses FP32 precision to reduce the accuracy difference between the deployment and training models; ONNX extracts the necessary intermediate tensor outputs at multiple subdivision levels by setting input and output nodes of different granularities, and provides three granularity options: output all nodes, specify input and output operator nodes, and specify operator node types;
[0093] Subsequently, the framework converts the adjusted ONNX model to adapt to different inference frameworks and converts it into an executable format for the target platform. In terms of data input, the benchmark framework pre-calculates and stores the tensor data of all output nodes. During the alignment process, the system automatically assigns the pre-stored input tensors to the framework to be aligned according to the input node name, and identifies the problematic operator nodes by comparing the outputs of the benchmark and inference frameworks layer by layer. The alignment baseline framework automatically performs model shape inference, automatically generates input tensors for the framework to be aligned and the benchmark, and ensures correctness by comparing the output tensors layer by layer.
[0094] By using the full node output or the coarse-grained method by operator type, the scope or type of operators that may have precision problems can be quickly located. After the potential problem operator is identified, it is switched to a finer granularity level - directly specifying the operator name for detailed analysis and inspection to avoid manually specifying a large number of operator names in the early stages. The problem scope can be quickly narrowed down through coarser granularity to effectively reduce the debugging workload; through fine third-level granularity positioning, accurate diagnosis and resolution of the problem operator can be ensured to avoid misdiagnosis and omissions;
[0095] After exporting the intermediate output operators, the new ONNX model will be directly connected to each target inference engine for model conversion; the alignment framework runs reasoning based on the aforementioned input method and compares the tensor output of each intermediate output node layer by layer; if a difference is detected, the framework will identify and report the location and name of the problematic operator; the cross-platform alignment method of intermediate activation tensors is used to effectively identify and resolve potential accuracy issues, ensuring consistent performance of lightweight models in different inference environments.
[0096] Step S3 comprises the following steps:
[0097] Step S31: Determine multiple inference platforms to be deployed, pre-install all dependent files and the intermediate representation file after precision alignment in step S23, and pre-use the intermediate representation to complete the calibration table of low-precision quantization in the development platform, use real data to input into the intermediate representation, obtain the histogram distribution data of most tensors, and package the above three files into a container to reduce the difficulty of reproducing the deployment environment;
[0098] Step S32: According to different computing platforms, the container of step S31 is deployed to the specified platform, and the model quantization tool chain of the corresponding reasoning framework is called by using the intermediate representation, calibration set and other dependent files to generate model weights in three reasoning formats: FP32, FP16 and INT8. According to the hardware structure characteristics of the platform, the reasoning platform is used to perform automatic reasoning optimization, and the weights of different precision formats of multiple reasoning platforms are stored in the container;
[0099] Step S33: Run the service on the designated platform to access the visualization system.
[0100] In step S33, the designated platform includes Nvidia Xavier, and the visual intelligent system uses Gradio front-end interaction to reduce environmental dependence. The user first selects a supported reasoning framework through a drop-down menu. After selection, another drop-down menu will automatically update the model weight accuracy options according to the reasoning format and accuracy supported by the current system; if the selected format is not supported in the current system, the system will prompt the user to reselect and display the unsupported reasoning format information;
[0101] For different access forms, if it is on the embedded side, the current hardware is automatically detected, and the written C++ real-time reasoning logic is used for dynamic binding to complete efficient reasoning; if it is on the Web side, FastAPI is used to provide backend services.
[0102] After the user selects the inference framework and precision, the system automatically preloads the corresponding model and data, calls the necessary inference runtime library and hardware resources including GPU for efficient model inference, and displays the results on the front-end interface; the interface displays the currently loaded weight file and updates the status in real time when the selected weight is not supported; users can upload original images for testing. After uploading, the image will be parsed and visualized, and the results will be displayed in the output image box. Users can also download the coordinate position of the object and its visualization image.
[0103] When the cross-platform lightweight model rotating target recognition system is used for satellites, preliminary data processing and target recognition are completed on the satellite side; that is, the student model optimized by knowledge distillation is run on the satellite platform to achieve efficient rotating target detection, and at the same time, the model deployment process is simplified by using ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform;
[0104] The cross-platform lightweight model rotating target recognition system is used to process data in real time during the flight of a drone to ensure the timeliness of the task. It uses a lightweight student model at the drone body to reduce the computing and energy consumption burden, and can be quickly deployed on different types of drone platforms through the full-link model deployment of the drone.
[0105] Example:
[0106] Satellites in orbit need to monitor changes on the earth's surface in real time, such as natural disasters, economic and military activities, and environmental monitoring. They need to quickly identify targets on the ground and perform adaptive positioning in rotation direction, such as ships, vehicles, and buildings. However, the computing resources and power consumption of satellite platforms are limited, and complex deep learning models cannot be deployed. The cost of data transmission is high, and preliminary data processing and target identification must be completed on the satellite side. Therefore, the student model optimized by knowledge distillation is run on the satellite platform to achieve efficient rotation target detection. At the same time, the model deployment process is simplified through ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform.
[0107] When drones collect ground images in the air, they need to identify and track targets in real time, such as people, vehicles, facilities, etc. This can be widely used in disaster relief, environmental monitoring, agricultural management and other fields. However, the payload and battery capacity of drones are limited, and the use of computing resources needs to be reduced as much as possible. Data needs to be processed in real time during flight to ensure the timeliness of the task. Therefore, a lightweight student model is used to reduce the computing and energy consumption burden. Through full-link model deployment, the model can be quickly deployed on different types of drone platforms.
Claims
1. A cross-platform lightweight model rotation target recognition system with full-link model deployment, characterized by: The steps include: Step S1: Construct a lightweight student model and a complex teacher model, build a task-oriented decoupled knowledge distillation framework, and explicitly transfer the prior knowledge of each subtask to the student model; Step S2: Use ONNX to convert the lightweight student model from the training format model to the platform-independent intermediate representation, build a cross-platform precision alignment framework, align the intermediate representation with the model weights and intermediate activations of the framework to be applied; Step S3: Use model quantization to complete the fixed-point compression of the lightweight model, convert some floating-point calculations to fixed-point calculations, use container technology to integrate multiple inference platforms into a visual real-time inference system, and complete the deployment of a cross-platform lightweight model rotation target recognition system.
2. According to the cross-platform lightweight model rotation target recognition system deployed by the full-link model according to claim 1, it is characterized by: In step S1, a lightweight student network and a complex teacher network model are constructed by collecting easily accessible multimodal image target detection datasets, and then a task-oriented knowledge distillation framework is constructed to realize knowledge transfer between models, including four subtasks of classification, positioning, angle and label assignment; Specifically, we first use multi-task distillation and neural network search to optimize the model structure and alignment mechanism, and then use a two-stage training strategy to strengthen the performance of the student model by first training independently and then jointly optimizing. Then, the lightweight student model after joint training is exported using the ONNX intermediate format, a cross-platform precision alignment framework is built, and weight alignment and intermediate activation alignment are performed to ensure the reasoning consistency of the model in the target reasoning platform and reasoning framework; Finally, container technology is used to store model weights in different precision formats of multiple inference platforms in containers, and the visualization system is run on the specified platform to provide users with an interactive interface for selecting the inference framework and precision.
3. According to the cross-platform lightweight model rotation target recognition system deployed by the full-link model according to claim 2, it is characterized by: In step S1, the student model and the teacher model form a task-oriented decoupled knowledge distillation framework, and the main members thereof input data. In the complex teacher model and the lightweight student model, the input data is a large amount of resource-rich multimodal image target detection dataset collected as the basis for model training. The teacher model is a high-performance, high-precision complex model with a deep network layer and a wide network width, as well as features with multiple parameters and high computational complexity, which are used to provide rich feature representations and soft labels during the training process, and guide the student model to learn more effective feature representations and decision boundaries; during learning, the student model constructs a shallow network structure and a narrow network width by adjusting the depth factor and the width factor, and ensures that it can run efficiently on resource-constrained and power-sensitive embedded edge computing platforms by reducing the number of parameters; The task-oriented distillation framework will present different topological relationships in the training stage and the inference stage. The topological relationship in the training stage is as follows: Fully supervised training is the first stage of the training stage. The student model and the teacher model are trained separately without joint training. The real rotated target labels and various data enhancement techniques are mainly used to allow the two models to learn basic feature representations and task capabilities. Joint training is the second stage of the training stage. The teacher model trained in the first stage is mainly used. At this time, its weights are frozen to guide the student model to conduct joint training. Under the guidance of the teacher model, the student model explicitly learns the prior knowledge of each subtask through task decoupling to improve its own performance. In the inference stage, only lightweight student models are deployed, and the teacher model does not participate in inference to ensure the efficiency and resource conservation of the system. The student model is converted into an ONNX intermediate representation, and after model quantization and cross-platform precision alignment, it is used to be deployed on the target hardware platform to achieve efficient cross-platform inference.
4. According to claim 3, the cross-platform lightweight model rotation target recognition system with full-link model deployment is characterized by: The core function of the data interaction interface between the student model and the teacher model is to focus on the joint training part in the training phase. The joint training uses the soft label distillation method, and uses the output probability distribution of the teacher model in the form of soft labels as the learning target of the student model. In the overall interaction process, the output of the teacher model is converted into a soft probability distribution through the Softmax function with a temperature parameter. The output of the student model is also softened, and the Kullback-Leibler divergence, i.e., KL divergence, between the two is calculated as the loss term. The automatic differentiation mechanism is used in the training framework to calculate the gradient and update the weight of the student model. Task Decoupling and Distillation The rotation object detection task is decoupled into the following four subtasks, and knowledge distillation is performed separately. Specifically, for classification tasks, the framework combines cross entropy loss with KL divergence; the classification probability distribution of the student model is made close to that of the teacher model, and the data interface used is the probability distribution of the classification output tensor; for positioning tasks, the training framework uses distributed focal loss DFL to model regression prediction as a probability distribution, and uses KL divergence to align the positioning probability distributions of the student model and the teacher model to improve the bounding box regression ability of the student model. The data interface used is the discrete probability distribution tensor output by the positioning branch; for angle prediction tasks, the training framework uses circular smooth labels to convert angle prediction into a classification problem, and improves the student model's ability to accurately predict the rotation angle of the target by combining cross entropy loss and KL divergence. The data interface used is the probability distribution tensor of the angle classification output; for label assignment tasks, the training framework calculates the dynamic alignment score of each anchor point, obtains the probability distribution through Softmax normalization, and uses KL divergence to align the probability distribution of anchor point assignment to make the anchor point assignment strategy of the student model consistent with that of the teacher model. The data interface used is the probability distribution tensor of the dynamic alignment score.
5. According to claim 2, the cross-platform lightweight model rotation target recognition system with full-link model deployment is characterized by: In step S1, the subtasks are uniformly detected, and the prediction head is soft distribution regression and task-oriented decoupled knowledge distillation: a lightweight student model and a complex teacher model are constructed, and the teacher model is used to decouple and transfer the prior knowledge of identifying each subtask to the student model, including the following steps; Step S11: collect easily accessible rich modality image target detection datasets for building lightweight student network and complex teacher network models; the baseline network uses the Efficient-Rep series, and the neck network uses FPN and PANet; the localization branch of the prediction network adopts the anchor-free FCOS idea to predict four position offsets l, t, r, b, and applies the distribution focus loss to convert the Dirac distribution of the box into a probability distribution; in addition, the localization branch uses circular smooth labels to convert angle predictions into classification predictions, and the paradigm of the unified subtask head is to predict soft distribution; Step S12: Use neural network search to adjust the model structure, and adjust the number of convolution blocks and network width by controlling the depth factor and width factor; the depth and width factors of the teacher model are both 1, and the depth and width of the lightweight student model are set to 0.33 and 0.50 respectively to meet the performance difference and inference speed requirements of edge devices; Step S13: A rotation box task alignment assignment mechanism is constructed to coordinate the classification confidence, regression quality, and angle prediction of anchor point prediction. Specifically, in the label assignment process, for each anchor point prediction, a multi-task alignment score is calculated, which consists of three parts: classification confidence c, angle classification confidence w, and regression quality μ; by using s to represent this weighted number, it can be expressed as: S=c α ×μ β ×w γ Where s represents the classification score of the multi-task decoupling head, where the classification score is the highest classification score among the anchor points, representing the overall classification confidence; μ represents the generalized intersection-over-union score of the rotation target predicted by the multi-task decoupling head of the anchor point and the ground truth box GT, and m represents the highest confidence value of the rotation angle classification head, representing the overall angle confidence; The overall process of the algorithm is as follows: suppose that each anchor point in the input feature map predicts the category score s, positioning score μ, and angle score m of the rotation box. First, predict the category score, positioning score, and angle score of the rotation box for each anchor point. Then, calculate the alignment score of each feature map grid point, and then check whether each anchor point is located inside its corresponding rotation box. If not, mark it as a negative sample. For anchor points that are still positive samples, select the first K as positive samples according to the size of the alignment score. Finally, normalize the alignment scores of these positive samples for subsequent loss function calculations. Step S14: using the rotation task alignment assignment and the specified modality rotation target detection dataset collected in step S11, a two-stage training strategy is adopted; In the first stage, the fully supervised student network and teacher network are trained independently, using only the rotated target labels from step S11 without joint training; Step S15: Construct a task-oriented decoupled knowledge distillation framework to achieve efficient knowledge transfer from complex high-performance models to lightweight models by explicitly decomposing the four subtasks of target classification, position regression, direction rotation and label assignment; the framework uses the pre-trained weights in the first stage as the initial weights of the teacher network, and in the second stage, through a joint training strategy, uses the logistic regression output of the teacher network for training, and utilizes the teacher network in four tasks, namely: classification, positioning, label assignment and soft distribution knowledge of angles.
6. The cross-platform lightweight model rotation target recognition system with full-link model deployment according to claim 5 is characterized by: In step S15, for the classification task, the output labels of the teacher model and the student model are expressed as These output labels are converted into probability distributions by using the Softmax function with a temperature parameter τ and In this process, the student model needs to minimize the loss functions including binary cross entropy (BCE) and Kullback-Leibler (KL) divergence to improve the accuracy and consistency of prediction; in the process of knowledge distillation, only the weight parameters of the student model are updated, and the weight of the teacher model is kept unchanged to ensure the stability of training, which can be expressed as: For the positioning task, the four outputs (l, t, r, b) of the regression prediction are modeled as general probability distributions and converted into discrete probability distributions through the DFL detection head. The output of the positioning branch is aligned with the classification branch before decoding, allowing the knowledge distillation method to be extended from image classification to positioning prediction, improving the model's ability to recognize the location of objects in the environment; the student model and the teacher model have the same bounding box The DFL soft labels predicted by the four variables are S reg and T reg ;pass S oftmax converted to probability distribution and The Kullback-Leibler (KL) divergence is used to evaluate the similarity between two distributions, which is expressed as: In the angle task, the Softmax function with a temperature parameter is used to soften the output distribution of the teacher and student models, making the probability distribution more informative; the student model is allowed to improve the detection accuracy by jointly learning the teacher model and the true label; in the angle distillation, the direction branch output of the student model and the teacher model, namely the angle soft label, is used Indicates; θ class represents the number of angle classifications, which is set to 180°, while W and H represent the width and height of the detection head branch in the predicted feature map, respectively. The formula is: In this setup, θ class represents a circular smooth label, and L CE and L KL Refers to the cross entropy loss and KL divergence respectively. θ is the coefficient used to reconcile the two losses, and the distillation process is only performed on the positive sample regions selected from the label distribution; The label assignment task achieves spatial alignment by reducing the difference in the distribution of dynamic alignment metric scores between the two models at the instance level; the label assignment distillation method uses the dynamic alignment coefficient distribution of each anchor point in a single truth box as a benchmark, and aligns by forcibly constraining these distributions of the teacher and student models to enhance the consistency between the soft labels of the teacher model and the true labels during training, and improve the accuracy and robustness of the model in practical applications; it can be expressed as: For a specific instance at position j, the total number of anchor points in the ground truth box of the instance is defined as N j ; For the i-th anchor point of this instance, the alignment score of the student model is expressed as The alignment score of the teacher model for the same anchor point is expressed as In order to solve the consistency problem of alignment distribution, the Softmax function is used to normalize the dynamic alignment scores of all anchor points in the instance to obtain the probability distribution of label assignment. These normalized scores are defined as and Mask-Softmax is adopted to exclude the interference of anchor point assignment outside the ground truth box, and the impact of instance size and dynamic alignment score on the results is alleviated by implementing a normalization process. By minimizing the KL divergence of the label assignment distribution between the teacher model and the student model, the loss function is defined as: When performing multi-task knowledge distillation, four parts are involved: position regression, category classification, angle positioning, and label assignment distillation. Specifically, in the early stages of training, the student model is more likely to receive and learn soft labels from the teacher model. As the training progresses, the performance of the student model gradually approaches that of the teacher model, and the help from the supervision constraints becomes more significant. In this process, the training strategy of the second stage emphasizes joint training, in which the weights of the student model are derived from the model trained in full supervision in the first stage. This stage also introduces stronger data enhancement techniques to further improve the generalization ability of the model. At the same time, the weights of the teacher model are frozen in the second stage of training to ensure its stability and focus on guiding the learning of the student model.
7. The cross-platform lightweight model rotation target recognition system with full-link model deployment according to claim 6 is characterized by: Step S2 comprises the following steps: Step S21, export the lightweight student model after the joint training in S15 using the ONNX intermediate format, and convert the lightweight student model into an intermediate expression independent of the hardware platform; Step S22, weight alignment is performed on the intermediate expression obtained in S21, and a recursive query is performed directly according to the initialization weight of the intermediate expression of the model to query the absolute number and relative number of weight tensors of a certain operator that exceed the representation range. At the same time, the weight distribution is used to evaluate the representation quality of the weight tensors of different operators in a specific data format, and the maximum representation accuracy of some operators is adjusted according to the actual position of some operators; Step S23: Determine the target reasoning platform and framework to ensure that the model is correctly executed in full-precision and half-precision reasoning formats; This step focuses on the intermediate activation tensors generated by the model during the inference process to ensure activation alignment between multiple platforms. As a benchmark framework, ONNX Runtime is selected as the main inference engine. The output level of all models uses FP32 precision to reduce the accuracy difference between the deployed and trained models. ONNX extracts the necessary intermediate tensor outputs at multiple subdivision levels by setting input and output nodes of different granularities, providing three granularity options: output all nodes, specify input and output operator nodes, and specify operator node types. The framework then converts the adjusted ONNX model to adapt to different inference frameworks and converts it into an executable format for the target platform. For data input, the benchmark framework pre-calculates and stores tensor data for all output nodes. During the alignment process, the system automatically assigns the pre-stored input tensors to the frame to be aligned according to the input node name, and identifies the problematic operator nodes by comparing the outputs of the benchmark and reasoning frames layer by layer. The alignment baseline frame automatically performs model shape inference, automatically generates the input tensors of the frame to be aligned and the benchmark, and ensures correctness by comparing the output tensors layer by layer. By using the full node output or the coarse-grained method by operator type, the scope or type of operators that may have precision problems can be quickly located. After the potential problem operator is identified, it is switched to a finer granularity level - directly specifying the operator name for detailed analysis and inspection to avoid manually specifying a large number of operator names in the early stages. The problem scope can be quickly narrowed down through coarser granularity to effectively reduce the debugging workload; through fine third-level granularity positioning, accurate diagnosis and resolution of the problem operator can be ensured to avoid misdiagnosis and omissions; After exporting the intermediate output operator, the new ONNX model will be directly connected to each target inference engine for model conversion; The alignment framework runs inference based on the aforementioned inputs and compares the tensor outputs of each intermediate output node layer by layer; If a discrepancy is detected, the framework will identify and report the location and name of the problematic operator; A cross-platform alignment method of intermediate activation tensors is used to effectively identify and resolve potential accuracy issues, ensuring consistent performance of lightweight models in different inference environments.
8. The cross-platform lightweight model rotation target recognition system with full-link model deployment according to claim 7 is characterized in that: Step S3 comprises the following steps: Step S31: Determine multiple inference platforms to be deployed, pre-install all dependent files and the intermediate representation file after precision alignment in step S23, and pre-use the intermediate representation to complete the calibration table of low-precision quantization in the development platform, use real data to input into the intermediate representation, obtain the histogram distribution data of most tensors, and package the above three files into a container to reduce the difficulty of reproducing the deployment environment; Step S32: According to different computing platforms, the container of step S31 is deployed to the specified platform, and the model quantization tool chain of the corresponding reasoning framework is called by using the intermediate representation, calibration set and other dependent files to generate model weights in three reasoning formats: FP32, FP16 and INT8. According to the hardware structure characteristics of the platform, the reasoning platform is used to perform automatic reasoning optimization, and the weights of different precision formats of multiple reasoning platforms are stored in the container; Step S33: Run the service on the designated platform to access the visualization system.
9. The cross-platform lightweight model rotation target recognition system with full-link model deployment according to claim 8 is characterized in that: In step S33, the designated platform includes Nvidia Xavier, and the visual intelligent system uses Gradio front-end interaction to reduce environmental dependence. The user first selects a supported reasoning framework through a drop-down menu. After selection, another drop-down menu will automatically update the model weight accuracy options according to the reasoning format and accuracy supported by the current system; if the selected format is not supported in the current system, the system will prompt the user to reselect and display the unsupported reasoning format information; For different access forms, if it is on the embedded side, the current hardware is automatically detected, and the written C++ real-time reasoning logic is used for dynamic binding to complete efficient reasoning; if it is on the Web side, FastAPI is used to provide backend services. After the user selects the inference framework and precision, the system automatically preloads the corresponding model and data, calls the necessary inference runtime library and hardware resources including GPU to perform efficient model inference, and displays the results on the front-end interface; the interface displays the currently loaded weight file and updates the status in real time when the selected weight is not supported; Users can upload raw images for testing. Once uploaded, the image is parsed and visualized, and the results are displayed in the output image box. Users can also download the coordinates of the object and its visualization image.
10. The cross-platform lightweight model rotation target recognition system with full-link model deployment according to claim 8 is characterized in that: When the cross-platform lightweight model rotating target recognition system is used for satellites, preliminary data processing and target recognition are completed on the satellite side; that is, the student model optimized by knowledge distillation is run on the satellite platform to achieve efficient rotating target detection, and at the same time, the model deployment process is simplified by using ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform; The cross-platform lightweight model rotating target recognition system is used to process data in real time during the flight of a drone to ensure the timeliness of the task. It uses a lightweight student model at the drone body to reduce the computing and energy consumption burden, and can be quickly deployed on different types of drone platforms through the full-link model deployment of the drone.
Citation Information
Patent Citations
Rapid ship detection method based on knowledge distillation and semi-supervised learning
CN114241285A
Knowledge distillation-based high-precision lightweight bridge crack identification method
CN116994130A
Real-time intelligent video analysis system, method and terminal based on edge calculation
CN118317125A
Lightweight machine reading understanding method for resource-constrained environment
CN118410870A
Self-distillation training method and device for convolutional neural network, and scalable dynamic prediction method
WO2021023202A1
Cited By
Copper ore classification method based on lightweight sliding window converter
CN120219862A
Multi-scene image style migration and edge calculation optimization method
CN120953099A