Cross-platform lightweight model rotating target recognition system deployed by full-link model
By constructing a task-oriented decoupled knowledge distillation framework with a lightweight student model and a complex teacher model, and combining ONNX intermediate representation and model quantization, the problem of efficient deployment and cross-platform accuracy alignment of rotating target recognition technology on embedded edge computing platforms is solved, achieving efficient and accurate rotating target recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-03-27
AI Technical Summary
Existing rotating target recognition technologies are difficult to deploy efficiently on resource-constrained and power-sensitive embedded edge computing platforms. Lightweight models cannot perform high-precision detection, and cross-platform deployment presents challenges in accuracy alignment and model optimization.
We construct lightweight student models and complex teacher models, adopt a task-oriented decoupled knowledge distillation framework, and achieve cross-platform accuracy alignment and fixed-point compression through ONNX intermediate representation and model quantization. We also utilize container technology to integrate them into a unified visual real-time inference system and optimize the model deployment process.
It achieves lightweight rotating target recognition that runs efficiently on resource-constrained platforms, ensuring inference consistency and accuracy of the model across different platforms, simplifying the cross-platform deployment process, and reducing computational resource overhead.
Smart Images

Figure CN119741471B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of lightweight rotating target detection and recognition, and particularly to a cross-platform lightweight model rotating target recognition system deployed by a full-link model. BACKGROUND
[0002] At present, efficient real-time rotating target recognition technology has been widely used in various terminal devices such as satellite and vehicle. Although the existing detection technology relies on a complex network structure to enhance feature extraction and scene adaptability, this method leads to a significant increase in model parameters and computational complexity, so that these high-performance complex models are not suitable for resource-constrained and power-sensitive embedded edge computing platforms. In addition, although the specially designed lightweight network model has advantages in inference speed and model simplicity, it usually cannot perform high-precision detection tasks, so it is particularly important to bridge the performance gap between lightweight models and complex models. However, most of the current knowledge distillation methods fail to effectively transfer directional knowledge, and the existing algorithms couple the task knowledge transfer with the knowledge distillation process, which limits the effect of the student model in obtaining soft knowledge related to specific subtasks.
[0003] On the other hand, most algorithms exhibit excellent performance in the preset development environment, but under the condition of limited computing resources and high-performance intelligent detection requirements, the deployment of lightweight models faces many challenges, especially in terms of being unable to quickly adapt to cross-inference frameworks to meet the needs of large-scale applications. Most of the current inference frameworks include their own precision alignment tools, and 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, most precision alignment tools only consider the morphological information of the operator node when generating input tensors for comparison, ignoring the distribution and range of actual input data, and often generate random tensors as input based on the operator shape, which may cause the data distribution of the input tensor to be inconsistent with the actual situation, thereby affecting the accuracy of the precision alignment evaluation. In addition, the existing model deployment process is extremely complex between multiple computing platforms and inference frameworks, which not only hinders the wide application of intelligent models, but also due to the tight coupling of each link of the model deployment, the lack of clear division makes it difficult to optimize a single link. In addition, the optimization strategies differ between different inference frameworks, making it difficult to ensure consistency across platforms, further increasing the difficulty of cross-end deployment of intelligent models.
[0004] In summary of the above problems, it can be seen that for the cross-platform lightweight rotating model recognition system, it is necessary to consider the knowledge compensation of lightweight models, decouple the knowledge distillation strategy, optimize the model deployment process, and cross-end precision alignment. It is necessary to make great improvements to the inference efficiency and inference accuracy of the lightweight model edge platform. SUMMARY
[0005] The application proposes a cross-platform lightweight model rotating target recognition system of full-link model deployment, focuses on meeting the strict requirements of practical application scenarios for computing resources, and carefully divides and clarifies each stage of intelligent model training and hardware deployment; comprehensively introduces knowledge distillation and model post-training technology, so that the number of neural network parameters is reduced and the computing resource overhead is reduced.
[0006] The application adopts the following technical solutions.
[0007] The cross-platform lightweight model rotating target recognition system of full-link model deployment comprises the following steps:
[0008] Step S1: constructing a lightweight student model and a complex teacher model, constructing a task-oriented decoupling knowledge distillation framework, and displaying prior knowledge of each subtask to the student model;
[0009] Step S2: converting the lightweight student model from a training format model to an intermediate representation independent of the platform by using ONNX, constructing a cross-platform precision alignment framework, and aligning the model weight and the intermediate activation of the intermediate representation and the to-be-applied framework;
[0010] Step S3: completing fixed-point compression of the lightweight model by using model quantization, converting part of the floating-point calculation to fixed-point calculation, uniformly integrating multiple inference platforms into a visual real-time inference system by using container technology, and completing deployment of the cross-platform lightweight model rotating target recognition system.
[0011] In step S1, a multi-modal image target detection dataset that is easy to obtain is collected to construct a lightweight student network and a complex teacher network model, 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 allocation; specifically: first, multi-task distillation and neural network search are used to optimize the model structure and alignment mechanism, and through a two-stage training strategy, independent training is first performed and then joint optimization is performed to strengthen the performance of the student model;
[0012] The lightweight student model after joint training is exported by using the ONNX intermediate format, a cross-platform precision alignment framework is constructed, and weight alignment and intermediate activation alignment are performed to ensure the consistency of inference of the model in the target inference platform and inference framework;
[0013] Finally, the model weights of different precision formats of multiple inference platforms are stored in the container by using container technology, and the visual system is run on the specified platform to provide an interactive interface for users to select the inference framework and precision.
[0014] In step S1, the student model and the teacher model constitute a task-oriented decoupled knowledge distillation framework, and the input data is collected from the main members of the framework. In the complex teacher model and the lightweight student model, the input data is a large number of resource-rich multi-modal image target detection data sets, which are used as the basis for model training. The teacher model is a high-performance and high-precision complex model with deep network levels and wide network widths, and has multiple parameters and high computational complexity. It is used to provide rich feature representations and soft labels in the training process to guide the student model to learn more effective feature representations and decision boundaries. In the learning process, the student model adjusts the depth factor and the width factor to build a shallow network structure and a narrow network width, and reduces the parameter amount to ensure that it can run efficiently on the resource-limited and power-sensitive embedded edge computing platform.
[0015] The task-oriented distillation framework presents different topological relationships in the training and inference stages. In the training stage, the topological relationship is as follows: full supervision training is the first stage of the training stage, and the student model and the teacher model are trained separately without joint training. Real rotation target labels and various data augmentation techniques are used to enable the two models to learn basic feature representations and task capabilities. Joint training is the second stage of the training stage, which mainly uses the teacher model trained in the first stage. The weights of the teacher model are frozen at this time to guide the student model for joint training. The student model learns the prior knowledge of each subtask explicitly through task decoupling under the guidance of the teacher model, thereby improving its performance. In the inference stage, only the lightweight student model is deployed, and the teacher model does not participate in the inference to ensure the efficiency and resource conservation of the system. The student model is converted into an ONNX intermediate representation, which is quantized and cross-platform accuracy aligned for deployment 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 for focusing on the joint training part in the training stage, the joint training uses a soft label distillation method, and the output probability distribution in the form of a soft label of the teacher model is used as the learning goal of the student model; in the overall interaction process, the output of the teacher model is converted into a soft probability distribution through a Softmax function with a temperature parameter; the output of the student model is also softened, and the Kullback-Leibler divergence, i.e., the KL divergence, between the two is calculated as a loss term, and the gradient is calculated and the weight of the student model is updated in the training framework using an automatic differentiation mechanism; the task decoupling distillation rotates the target detection task into four subtasks, and knowledge distillation is performed on each subtask. Specifically, for the classification task, the framework combines the cross-entropy loss and the KL divergence; the classification probability distribution of the student model is close to that of the teacher model, and the data interface used is the probability distribution of the classification output tensor; for the positioning task, the training framework uses a distributed focal loss (DFL) to model the regression prediction as a probability distribution, and the KL divergence is used to align the positioning probability distribution of the student model and the teacher model to improve the bounding box regression ability of the student model, and the data interface used is the discrete probability distribution tensor output by the positioning branch; for the angle prediction task, the training framework converts the angle prediction into a classification problem by using a circular smooth label, and combines the cross-entropy loss and the KL divergence to improve the ability of the student model to accurately predict the rotation angle of the target, and the data interface used is the probability distribution tensor output by the angle classification; for the label assignment task, the training framework calculates the dynamic alignment score of each anchor point, normalizes the probability distribution through Softmax normalization, and uses the KL divergence to align the probability distribution of the anchor point assignment to make the anchor point assignment strategy of the student model consistent with that of the teacher model, and the data interface used is the probability distribution tensor of the dynamic alignment score.
[0017] In step S1, the subtask detection is unified, the prediction head is soft distribution regression, and the task-oriented decoupling knowledge distillation is performed: a lightweight student model and a complex teacher model are constructed, the teacher model is used to decouple and deliver prior knowledge of each subtask to the student model, including the following steps.
[0018] Step S11: collect rich modal image target detection data sets that are easy to obtain, for constructing a lightweight student network and a complex teacher network model; the baseline network selects the Efficient-Rep series, the neck network uses FPN and PANet; the positioning branch of the prediction network adopts the anchor-free FCOS idea, and predicts four position offsets l, t, r, and b; the distribution focal loss is applied to convert the Dirac distribution of the frame into a probability distribution; in addition, the positioning branch uses a circular smooth label to convert the angle prediction into a classification prediction, and the paradigm of the subtask head is unified as a prediction soft distribution.
[0019] Step S12: search for an adjusted model structure using a neural network, adjust the number of convolutional 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 respectively set to 0.33 and 0.50 to meet the performance difference and inference speed requirement of the edge device; step S13: a rotation task alignment distribution mechanism is constructed to coordinate the classification confidence, regression quality and angle prediction of anchor point prediction. Specifically, in the label distribution process, for the prediction of each anchor point, a multi-task alignment score is calculated, which is composed of three parts of classification confidence c, angle classification confidence w and regression quality μ; by using s to represent this weighting method, the formula is expressed as: S = c α × μ β × w γ
[0020]
[0021] Where s represents the classification score of the multi-task decoupling head, and the classification score is the highest value in the anchor point multi-class classification score, representing the overall classification confidence; μ represents the generalized intersection over union score of the predicted rotation target of the anchor point multi-task decoupling head 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 flow of the algorithm is as follows: assuming that the input feature map is the class score s of each anchor point prediction of the rotated box, the positioning score μ, and the angle score m, first, the class score, the positioning score and the angle score of each anchor point of the rotated box are predicted, then the alignment score of each feature map grid point is calculated, then it is checked whether each anchor point is located inside the corresponding rotated box, if not, it is marked as a negative sample, for the anchor points that are still positive samples, the top K is selected as the positive sample according to the size of the alignment score, and finally, the alignment score of these positive samples is normalized for subsequent loss function calculation;
[0023] Step S14: use the rotation task alignment distribution and the specified modal rotation target detection data set collected in step S11 to adopt a two-stage training strategy; in the first stage, the fully supervised student network and the teacher network are independently trained, only the rotation target label of step S11 is used, and no joint training is performed;
[0024] Step S15: Construct a task-oriented decoupled knowledge distillation framework. By explicitly decomposing four sub-tasks—target classification, position regression, orientation rotation, and label assignment—it achieves efficient knowledge transfer from a complex, high-performance model to a lightweight model. This framework uses the pre-trained weights from the first stage as the initial weights of the teacher network. In the second stage, it uses a joint training strategy to train the teacher network using the logistic regression output of the teacher network. In the four tasks, it utilizes the soft distribution knowledge of the teacher network, namely, classification, localization, label assignment, and angle.
[0025] In step S15, for the classification task, the output labels of the teacher model and the student model are represented as follows: These output labels are transformed into a probability distribution using a softmax function with a temperature parameter τ. and In this process, the student model needs to minimize the loss function, including binary cross-entropy (BCE) and Kullback-Leibler (KL) divergence, to improve the accuracy and consistency of predictions. During knowledge distillation, only the weight parameters of the student model are updated, while the weights of the teacher model remain unchanged to ensure training stability, as expressed by the formula:
[0026]
[0027] For the localization task, the four outputs (l, t, r, b) of the regression prediction are modeled as a general probability distribution and transformed into a discrete probability distribution using the DFL detector head. The output of the localization branch is aligned with the classification branch before decoding, allowing the knowledge distillation method to be extended from image classification to localization prediction, improving the model's ability to recognize the location of objects in the environment. The student model and the teacher model use the same bounding box. The four variables predicted the soft labels of DFL as follows: S reg and T reg ;pass S oftmax is transformed into a probability distribution and The Kullback-Leibler (KL) divergence is used to evaluate the similarity between two distributions, expressed by the formula:
[0028]
[0029] In the angle distillation task, a Softmax function with a temperature parameter is used to soften the output distributions of the teacher and student models, making the probability distributions more informative. This allows the student model to improve detection accuracy by jointly learning from the teacher model and the ground truth labels. In the angle distillation process, the directional branch outputs of the student and teacher models, i.e., the angle soft labels, are used... Represents; θ classThe number of angle classes is set to 180°, and W and H represent the width and height of the branch of the detection head in the predicted feature map, respectively. The formula is expressed as:
[0030]
[0031]
[0032] In this setting, θ class represents the circular smooth label, and L CE and L KL respectively refer to the cross-entropy loss and the KL divergence. λ θ 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 assignment;
[0033] The label assignment task achieves spatial alignment by reducing the difference between the dynamic alignment score distribution of the two models at the instance level; the label assignment distillation method uses the dynamic alignment coefficient distribution of each anchor point within a single ground truth box as a benchmark, and aligns the distributions of the teacher and student models by forcing constraints to enhance the consistency between the teacher model soft label and the real label during training, and to improve the accuracy and robustness of the model in actual application; the formula is expressed as:
[0034]
[0035] For a specific instance located at position j, the total number of anchor points within the instance ground truth box is defined as N j ; for the i-th anchor point of the instance, the alignment score of the student model is represented as and the alignment score of the teacher model for the same anchor point is represented as To solve the consistency problem of the alignment distribution, the dynamic alignment scores of all anchor points within the instance are normalized using the Softmax function to obtain the probability distribution of the label assignment. These normalized scores are defined as and Mask-Softmax is used to exclude the interference of anchor point assignments outside the ground truth box, and the standardization process is implemented to reduce the impact of instance size and dynamic alignment score on the results. 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] In the execution of multi-task knowledge distillation, four parts are involved: position regression, category classification, angle positioning and label assignment distillation. Specifically, in the early stage of training, the student model is more likely to receive and learn the soft label from the teacher model. As the training goes deeper, the performance of the student model gradually approaches that of the teacher model, at which point the help from the supervision constraint becomes more significant; In this process, the training strategy in the second stage emphasizes joint training, in which the weight of the student model comes from the model trained in the first stage under full supervision; This stage also introduces stronger data augmentation techniques to further improve the generalization ability of the model; At the same time, the weight of the teacher model is 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, the lightweight student model after S15 joint training is exported using the ONNX intermediate format, and the lightweight student model is converted into a hardware platform-independent intermediate expression;
[0040] Step S22, the intermediate expression obtained in S21 is aligned in weight, and the absolute number and relative number of the weight tensor of a certain operator that exceeds the representation range are directly queried according to the initialization weight of the model intermediate expression, and the representation quality of the weight tensor of different operators under a certain data format is evaluated using the weight distribution, and the position of some operators is adjusted according to the actual situation, and the highest representation precision of some operators is adjusted;
[0041] Step S23, determine the inference platform and framework of the target, ensure that the model can be correctly executed in full-precision and half-precision inference format; This step focuses on the intermediate activation tensor generated by the model in the inference process to ensure the activation alignment between multiple platforms; As a benchmark framework, ONNXRuntime is selected as the main inference engine, and the output level of all models adopts FP32 precision to reduce the precision difference between the deployed and trained models; ONNX extracts the necessary intermediate tensor output at multiple subdivision levels by setting different granularity input and output nodes, providing 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 precomputes and stores the tensor data of all output nodes; In the alignment process, the pre-stored input tensor is automatically assigned to the framework to be aligned according to the input node name, and the problem operator node is identified by comparing the output of the benchmark and inference framework layer by layer; The baseline framework automatically performs model shape inference to automatically generate input tensors for the alignment and benchmark framework, and ensures correctness by comparing output tensors layer by layer;
[0043] By using the full node output or the coarse-grained method by operator type to quickly locate the range or type of operators that may have precision problems, after determining the potential problem operator, switch to a finer granularity level - directly specify the operator name for detailed analysis and verification to avoid manually specifying a large number of operator names in the early stage, reduce the debugging workload by quickly narrowing down the problem range through coarse granularity, and ensure accurate diagnosis and solution of the problem operator through fine third-level granularity to avoid misdiagnosis and omission.
[0044] After deriving 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 according to the aforementioned input method and compares the tensor output of each intermediate output node layer by layer; if differences are detected, the framework will identify and report the location and name of the problem operator; the cross-platform alignment method of intermediate activation tensors is used to effectively identify and solve potential precision problems, ensuring consistent performance of lightweight models in different inference environments.
[0045] Step S3 includes the following steps:
[0046] Step S31: Determine the specified deployment of multiple inference platforms, pre-install all dependent files and intermediate representation files after precision alignment in step S23, and simultaneously pre-complete the calibration table of low-precision quantization in the development platform using the intermediate representation, input real data into the intermediate representation to obtain 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, deploy the container of step S31 to the specified platform, use the intermediate representation, calibration set, and other dependent files, call the model quantization tool chain of the corresponding inference framework, and generate FP32, FP16, and INT8 three inference format model weights respectively, according to the hardware structure characteristics of the platform, use the inference platform for automatic inference optimization, and store the weights of different precision formats of multiple inference platforms into the container;
[0048] Step S33: Run the service on the specified platform to access the visualization system.
[0049] In step S33, the specified platform includes Nvidia Xavier, and the visualization intelligent system uses Gradio front-end interaction to reduce environmental dependence. The user first selects the supported inference framework through a drop-down menu, after selection, another drop-down menu will automatically update the model weight precision options according to the inference format and precision 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 inference format information;
[0050] For different access forms, if it is an embedded end side, the current hardware is automatically detected, then the prepared C++ real-time inference logic is used for dynamic binding to complete efficient inference; if it is a Web end side, a backend service is provided by using FastAPI,
[0051] After the user selects the inference framework and precision, the system automatically preloads the corresponding model and data, calls necessary inference runtime libraries and hardware resources including GPUs 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; the user can upload an original image for testing. After uploading, the image is parsed and visualized, and the results are displayed in the output image box. The user can also download the coordinate position of the object and its visualized image.
[0052] The cross-platform lightweight model rotating target recognition system is used for satellites, and preliminary data processing and target recognition are completed at the satellite end; that is, a student model optimized through knowledge distillation is run on a satellite platform to achieve efficient rotating target detection, and the model deployment process is simplified by using an ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform.
[0053] When the cross-platform lightweight model rotating target recognition system is used for real-time data processing during the flight of an unmanned aerial vehicle to ensure the timeliness of the task, a lightweight student model is used at the unmanned aerial vehicle body to reduce the computational and energy consumption burden, and a full-link model deployment of the unmanned aerial vehicle is used to quickly deploy on different types of unmanned aerial vehicle platforms.
[0054] The application discloses a cross-platform lightweight model rotating target identification system based on full-link model deployment, which comprises a lightweight child model for constructing uniform distribution regression and a complex teacher model neural network, a rotating task alignment distribution mechanism is constructed to optimize a supervised training process, and a task-oriented decoupling knowledge distillation framework is constructed to perform deep compression on the lightweight model. The lightweight child model is converted from a training format model to a platform-independent intermediate representation by using ONNX, a cross-platform precision alignment framework is constructed, and model weight alignment and intermediate activation alignment of the intermediate representation and a to-be-applied framework are performed. Fixed-point compression of the lightweight model is completed by using model quantization, part of floating-point calculation is converted to fixed-point calculation, a plurality of inference platforms are uniformly integrated into a visual real-time inference system by using container technology, and three steps of full-link deployment of the cross-platform lightweight model rotating target identification system are completed. The application provides a full-link model deployment method, which meets strict requirements of actual application scenarios for computing resources, and carefully divides and clarifies various stages such as intelligent model training and hardware deployment. Knowledge distillation and model post-training technologies are comprehensively introduced, so that the number of neural network parameters is reduced, and computing resource consumption is reduced. The system hides complex deployment details of multiple platforms, so that users can conveniently test a currently used rotating target detection model across platforms and frameworks. By using an interfaced and platformized design, the difficulty of algorithm application is significantly reduced. BRIEF DESCRIPTION OF DRAWINGS
[0055] The application will be described in further detail below in combination with the drawings and specific embodiments:
[0056] The accompanying drawings are schematic diagrams of the application; Figure 1 is a flowchart of the application;
[0057] The accompanying drawings are schematic diagrams of the application; Figure 2 is a principle schematic diagram of a lightweight child network and a complex teacher network model. DETAILED DESCRIPTION
[0058] As shown in the figure, the cross-platform lightweight model rotating target identification system based on full-link model deployment comprises the following steps:
[0059] Step S1: constructing a lightweight child model and a complex teacher model, constructing a task-oriented decoupling knowledge distillation framework, and displaying prior knowledge of each subtask to the student model;
[0060] Step S2: converting the lightweight child model from a training format model to a platform-independent intermediate representation by using ONNX, constructing a cross-platform precision alignment framework, and aligning the intermediate representation and model weight alignment and intermediate activation alignment of a to-be-applied framework;
[0061] Step S3: The fixed-point compression of the lightweight model is completed by model quantization, the container technology is used to integrate multiple inference platforms into a visual real-time inference system, and the deployment of the cross-platform lightweight model rotating target recognition system is completed.
[0062] In step S1, a lightweight student network and a complex teacher network model are constructed using a multi-modal image target detection dataset that is easy to collect, and a task-oriented knowledge distillation framework is constructed to realize knowledge transfer between models, including four sub-tasks of classification, positioning, angle, and label assignment. Specifically, first, multi-task distillation and neural network search are used to optimize the model structure and alignment mechanism, and a two-stage training strategy is used to first train independently and then optimize jointly to strengthen the performance of the student model.
[0063] The lightweight student model trained jointly is then exported using the ONNX intermediate format, a cross-platform precision alignment framework is constructed, and weight alignment and intermediate activation alignment are performed to ensure consistency in inference on the target inference platform and inference framework.
[0064] Finally, container technology is used to store model weights of different precision formats of multiple inference platforms in the container, and a visual system is run on the specified platform to provide an interactive interface for users to select inference frameworks and precision.
[0065] In step S1, the student model and the teacher model constitute a task-oriented decoupled knowledge distillation framework, and the input data is a large amount of resource-rich multi-modal image target detection dataset collected as the basis for model training. The teacher model is a complex model with high performance and high precision, with deep network levels and wide network widths, as well as multiple parameters and high computational complexity, which is used to provide rich feature representations and soft labels in the training process to guide the student model to learn more effective feature representations and decision boundaries. In the learning process, the student model adjusts the depth factor and the width factor to construct a shallow network structure and a narrow network width, reduces the number of parameters, and ensures efficient operation on resource-constrained and power-sensitive embedded edge computing platforms.
[0066] The task-oriented distillation framework presents different topological relationships in the training stage and the inference stage. The topological relationship in the training stage is as follows: full supervision training is used as the first stage of the training stage, the student model and the teacher model are trained respectively, and no joint training is performed. Real rotation target labels and various data enhancement techniques are mainly used to enable the two models to learn basic feature representation and task capability respectively; joint training is used as the second stage of the training stage, and the teacher model trained in the first stage is mainly used. At this time, the weights of the teacher model are frozen, and the student model is trained jointly. The student model learns the prior knowledge of each subtask explicitly through task decoupling under the guidance of the teacher model, thereby improving its performance; in the inference stage, only the lightweight student model is deployed, and the teacher model does not participate in inference, thereby ensuring 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 deploy on the target hardware platform to realize efficient cross-platform inference.
[0067] The core function of the data interaction interface between the student model and the teacher model is used for focusing on the joint training part in the training stage. The joint training uses a soft label distillation method, and the output probability distribution in the form of a soft label of the teacher model is used 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 a Softmax function with a temperature parameter; the output of the student model is also softened, and the Kullback-Leibler divergence, i.e., the KL divergence, between the two is calculated as a loss term. In the training framework, the gradient is calculated and the weight of the student model is updated by using an automatic differentiation mechanism; the task decoupling distillation of the rotation target detection task is decoupled into four subtasks, and knowledge distillation is performed on each subtask. Specifically, for the classification task, the framework combines the cross-entropy loss and the KL divergence; the classification probability distribution of the student model is close to that of the teacher model, and the data interface used is the probability distribution of the classification output tensor; for the positioning task, the training framework uses a distributed focal loss (DFL) to model the regression prediction as a probability distribution, and uses the KL divergence to align the positioning probability distribution of the student model and the teacher model to improve the bounding box regression capability of the student model. The data interface used is the discrete probability distribution tensor output by the positioning branch; for the angle prediction task, the training framework converts the angle prediction into a classification problem by using a circular smooth label, and combines the cross-entropy loss and the KL divergence to improve the ability of the student model to accurately predict the rotation angle of the target. The data interface used is the probability distribution tensor of the angle classification output; for the label assignment task, the training framework calculates the dynamic alignment score of each anchor point, normalizes the probability distribution through Softmax normalization, and uses the KL divergence to align the probability distribution of the 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] The unified sub-task detection in step S1 has a soft distribution regression prediction head and a task-oriented decoupling knowledge distillation: a lightweight student model and a complex teacher model are constructed, and the teacher model is used to decouple and deliver the prior knowledge of each sub-task to the student model, including the following steps.
[0069] Step S11: Collect rich modal image target detection data sets that are easy to obtain, for constructing lightweight student network and complex teacher network models; the baseline network selects the Efficient-Rep series, and the neck network uses FPN and PANet; the positioning branch of the prediction network adopts the anchor-free FCOS idea, and predicts four position offsets l, t, r, b; the distribution focal loss is applied to convert the Dirac distribution of the frame into a probability distribution; in addition, the positioning branch uses a circular smooth label to convert angle prediction into classification prediction, and the paradigm of the sub-task head is to predict soft distribution;
[0070] Step S12: Adjust the model structure by using neural network search, 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 frame task alignment distribution mechanism is constructed to coordinate the classification confidence, regression quality and angle prediction of anchor point prediction. Specifically, in the label distribution process, for the prediction of each anchor point, a multi-task alignment score is calculated, which is composed of classification confidence c, angle classification confidence w and regression quality μ; by using s to represent this weighting method, it can be expressed by the formula: S=c α ×μ β ×w γ
[0071]
[0072] Where s represents the classification score of the multi-task decoupling head, and the classification score is the highest value in the anchor multi-class classification score, representing the overall classification confidence; μ represents the generalized intersection over union score of the predicted rotation target of the anchor multi-task decoupling head and the ground truth frame GT, and m represents the highest confidence value of the rotation angle classification head, representing the overall angle confidence;
[0073] The overall flow of the algorithm is as follows: assuming that the input feature map is an anchor point to predict the class score s of the rotating frame, the positioning score μ, and the angle score m, first, the class score, positioning score, and angle score of the rotating frame of each anchor point are predicted, then the alignment score of each feature map grid point is calculated, then it is checked whether each anchor point is located inside the corresponding rotating frame, if not, it is marked as a negative sample, for the anchor points that are still positive samples, the top K is selected as the positive sample according to the size of the alignment score, and finally, the alignment score of the positive sample is normalized for subsequent loss function calculation;
[0074] Step S14: using the rotation task alignment distribution and the specified modal rotation target detection data set 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 independently trained, only using the rotation target label of step S11, without joint training;
[0075] Step S15: a task-oriented decoupled knowledge distillation framework is constructed, which realizes efficient knowledge transfer from a complex high-performance model to a lightweight model by explicitly decomposing four sub-tasks of target classification, position regression, direction rotation, and label distribution; the framework uses the pre-training weight of the first stage as the initial weight of the teacher network, and in the second stage, the teacher network is used for training through a joint training strategy using the logistic regression output of the teacher network, and the four tasks use the teacher network, namely: classification, positioning, label distribution, and angle soft distribution knowledge.
[0076] In step S15, for the classification task, the output labels of the teacher model and the student model are represented as By using the Softmax function with temperature parameter τ, these output labels are converted into probability distributions And In this process, the student model needs to minimize the loss function including binary cross entropy (BCE) and Kullback-Leibler (KL) divergence to improve the accuracy and consistency of the prediction; during the knowledge distillation process, only the weight parameters of the student model are updated, and the weights of the teacher model remain unchanged to ensure the stability of the 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 by the DFL detection head, and 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 position 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 variants are S reg and T reg , respectively, converted to probability distribution by S oftmax and The similarity between two distributions is evaluated using the Kullback-Leibler (KL) divergence, which is formulated as:
[0079]
[0080] In the angle task, the Softmax function with 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 detection accuracy by jointly learning the teacher model and the real label; in angle distillation, the output of the direction branch of the student and teacher models, i.e., the angle soft label, is denoted as , where class represents the number of angle classifications, which is set to 180°, and W and H represent the width and height of the detection head branch in the predicted feature map, respectively, which is formulated as:
[0081]
[0082]
[0083] In this setting, the class represents the circular smooth label, and L CE and L KL represent the cross-entropy loss and the 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 assignment;
[0084] The label assignment task achieves spatial alignment by reducing the difference between the dynamic alignment score distribution of the two models at the instance level; the label assignment distillation method uses the dynamic alignment coefficient distribution of each anchor point within a single ground truth box as a reference, and aligns the distributions of the teacher and student models by forcing constraints to enhance the consistency between the teacher model soft label and the real label during training, and to improve the accuracy and robustness of the model in practical applications; which is formulated as:
[0085]
[0086] For a specific instance located at position j, the total number of anchor points within the instance ground truth box is defined as N j ; for the i-th anchor point of the instance, the alignment score of the student model is denoted as and the alignment score of the same anchor point of the teacher model is denoted as 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 used to exclude the interference of anchor point assignment outside the true value box, and the influence of instance size and dynamic alignment score on the result is reduced by implementing a standardization process. By minimizing the KL divergence of the label assignment distribution between the teacher model and the student model, the definition of the loss function is expressed in the formula:
[0087]
[0088] When performing multi-task knowledge distillation, four parts are involved: position regression, class classification, angle positioning and label assignment distillation. Specifically, in the early stage 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, at which point the help from the supervision constraint becomes more significant; In this process, the training strategy in the second stage emphasizes joint training, in which the weights of the student model come from the model trained in the first stage under full supervision; This stage also introduces stronger data augmentation techniques to further improve the generalization ability of the model; At the same time, the weights of the teacher model are frozen during 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, the lightweight student model after S15 joint training is exported using the ONNX intermediate format, and the lightweight student model is converted into a hardware platform-independent intermediate expression;
[0091] Step S22, the intermediate expression obtained in S21 is subjected to weight alignment, and the absolute number and relative number of weights that exceed the representation range in the weight tensor of a certain operator are directly queried according to the initialization weights of the intermediate expression of the model, and the representation quality of the weight tensor of different operators under a certain data format is evaluated using the weight distribution, and the position of some operators is adjusted according to the actual representation accuracy of some operators;
[0092] Step S23, determine the inference platform and framework of the target, 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 inference to ensure the alignment of activations between multiple platforms; as a reference framework, ONNXRuntime is selected as the main inference engine, and the output level of all models uses FP32 precision to reduce the precision difference between deployed and trained models; ONNX extracts necessary intermediate tensor outputs at multiple subdivision levels by setting different granularity input and output nodes, providing 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 reference framework precomputes and stores tensor data for all output nodes; during alignment, the system automatically assigns pre-stored input tensors to the framework to be aligned according to the input node name, and identifies problem operator nodes by comparing the output of the reference and inference frameworks layer by layer;
[0094] By using full-node output or coarse-grained methods by operator type to quickly locate the range or type of operators that may have precision problems, after determining the potential problem operators, switch to a finer granularity level—directly specify the operator name for detailed analysis and verification, to avoid manually specifying a large number of operator names in the early stage, and to effectively reduce the debugging workload by quickly narrowing down the problem range with coarse granularity; through fine-grained third-level positioning, ensure accurate diagnosis and solution of problem operators, avoid misdiagnosis and omission;
[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 inference according to 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 problem operator; use the cross-platform alignment method of intermediate activation tensors to effectively identify and solve potential precision problems, ensuring consistent performance of lightweight models in different inference environments.
[0096] Step S3 includes the following steps;
[0097] Step S31: Determine the specified deployment of multiple reasoning platforms, pre-install all dependent files and intermediate representation files after precision alignment in step S23, and pre-complete the calibration table of low-precision quantization in the development platform using the intermediate representation. Real data is input into the intermediate representation to obtain histogram distribution data of most tensors. The above three files are packaged into a container to reduce the difficulty of replicating the deployment environment;
[0098] Step S32: According to different computing platforms, deploy the container of step S31 to the specified platform, use the intermediate representation, calibration set and other dependent files, call the model quantization tool chain of the corresponding reasoning framework, and generate FP32, FP16 and INT8 three inference format model weights respectively. According to the hardware structure characteristics of the platform, use the reasoning platform to perform automatic reasoning optimization, and store the weights of different precision formats of multiple reasoning platforms into the container;
[0099] Step S33: Run the service on the specified platform to access the visualization system.
[0100] In step S33, the specified platform includes Nvidia Xavier, and the visualization intelligent system uses Gradio front-end interaction to reduce environmental dependence. The user first selects the supported reasoning framework through a drop-down menu. After selection, another drop-down menu will automatically update the model weight precision options according to the reasoning format and precision 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 an embedded end 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 a web side, FastAPI is used to provide a backend service,
[0102] After the user selects the reasoning framework and precision, the system automatically preloads the corresponding model and data, calls the necessary reasoning runtime library and hardware resources including GPU to perform efficient model reasoning, 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. The user can upload the original image for testing. After uploading, the image is parsed and visualized, and the result is displayed in the output image box. The user can also download the coordinate position of the object and its visualization image.
[0103] The cross-platform lightweight model rotating target recognition system is used for satellites, and preliminary data processing and target recognition are completed at the satellite end; that is, a student model optimized through knowledge distillation is run on a satellite platform to achieve efficient rotating target detection, and the model deployment process is simplified through ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform.
[0104] When the cross-platform lightweight model rotating target recognition system is used for real-time data processing during the flight of a UAV to ensure the timeliness of the task, a lightweight student model is used at the UAV body to reduce the computational and energy consumption burden, and the full-link model deployment of the UAV is used to quickly deploy the model on different types of UAV platforms.
[0105] Embodiments:
[0106] Satellites need to monitor changes on the surface of the earth in real time while in orbit, such as natural disasters, economic and military activities, environmental monitoring, etc., and need to quickly identify targets on the ground and perform rotating direction adaptive positioning, such as ships, vehicles, buildings, etc. However, the computing resources and power consumption of the satellite platform are limited, and complex deep learning models cannot be deployed. The cost of data transmission is high, and preliminary data processing and target recognition need to be completed at the satellite end. Therefore, a student model optimized through knowledge distillation is run on a satellite platform to achieve efficient rotating target detection, and the model deployment process is simplified through ONNX intermediate representation and model quantization to adapt to the special environment of the satellite platform.
[0107] A UAV needs to collect ground images in the air and needs to identify and track targets such as crowds, vehicles, facilities, etc. in real time, which can be widely used in disaster relief, environmental monitoring, agricultural management, etc. However, the payload and battery capacity of the UAV are limited, and the occupation of computing resources needs to be reduced as much as possible. Real-time data processing is needed during flight to ensure the timeliness of the task. Therefore, a lightweight student model is used to reduce the computational and energy consumption burden, and the full-link model deployment is used so that the model can be quickly deployed on different types of UAV platforms.
Claims
1. A cross-platform lightweight model rotation target recognition system with end-to-end model deployment, characterized in that: Includes the following steps; Step S1: Construct a lightweight student model and a complex teacher model, build a task-oriented decoupled knowledge distillation framework, and explicitly pass the prior knowledge of each sub-task to the student model; Step S2: Use ONNX to transfer the lightweight student model from the training format model to a platform-independent intermediate representation, build a cross-platform precision alignment framework, and 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, and use container technology to integrate multiple inference platforms into a unified visual real-time inference system to complete the deployment of a cross-platform lightweight model rotating target recognition system. In step S1, the sub-task detection is unified, and its prediction head is soft distribution regression and task-oriented decoupled knowledge distillation: construct a lightweight student model and a complex teacher model, and use the teacher model to decouple and pass the prior knowledge of recognizing each sub-task to the student model, including the following steps; Step S11: Collect readily available and abundant modal image object detection datasets. Step S12: Use neural network search to adjust the model structure, and adjust the number of convolutional blocks and network width by controlling the depth factor and width factor; Step S13: A rotating box task alignment assignment mechanism was constructed to coordinate the classification confidence, regression quality, and angle prediction of anchor point prediction; Step S14: Align the assigned rotation task with the specified modality rotation target detection dataset collected in step S11; Step S15: Construct a task-oriented decoupled knowledge distillation framework.
2. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 1, characterized in that: 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. Then, a task-oriented knowledge distillation framework is constructed to realize knowledge transfer between models, including four sub-tasks: classification, localization, angle, and label assignment. Specifically, the model structure and alignment mechanism are first optimized by using multi-task distillation and neural network search. Then, a two-stage training strategy is adopted, which involves independent training followed by joint optimization to enhance the performance of the student model. The jointly trained lightweight student model is then exported using the ONNX intermediate format. A cross-platform precision alignment framework is constructed, and weight alignment and intermediate activation alignment are performed to ensure the consistency of the model's inference in the target inference platform and inference framework. Finally, container technology is used to store model weights of different precision formats from multiple inference platforms into containers, and a visualization system is run on a specified platform to provide users with an interactive interface for selecting inference frameworks and precision.
3. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 2, characterized in that: In step S1, the student model and the teacher model constitute a task-oriented, decoupled knowledge distillation framework. The main members of this framework input data. In both the complex teacher model and the lightweight student model, the input data is a large, resource-rich multimodal image object detection dataset, serving as the basis for model training. The teacher model, as a high-performance, high-precision complex model, has deep network layers and a wide network width, as well as features with multiple parameters and high computational complexity. It provides rich feature representations and soft labels during training, guiding the student model to learn more effective feature representations and decision boundaries. During learning, the student model adjusts the depth and width factors to construct a shallow network structure and a narrow network width, reducing the number of parameters to ensure efficient operation on resource-constrained and power-sensitive embedded edge computing platforms. The task-oriented distillation framework exhibits different topological relationships during the training and inference phases. The training phase's topological relationships are as follows: First, fully supervised training is conducted separately for both the student and teacher models, without joint training. Real rotating target labels and various data augmentation techniques are primarily used to allow each model to learn basic feature representations and task capabilities. Second, joint training utilizes the teacher model trained in the first phase, freezing its weights to guide the student model in joint training. Under the teacher model's guidance, the student model explicitly learns prior knowledge of each subtask through task decoupling, improving its performance. During the inference phase, only lightweight student models are deployed; the teacher model does not participate in inference, ensuring system efficiency and resource conservation. The student model is converted to an ONNX intermediate representation, quantized, and cross-platform precision aligned before deployment on the target hardware platform for efficient cross-platform inference.
4. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 3, characterized in that: The core function of the data interaction interface between the student model and the teacher model is to focus on the joint training part during the training phase. The joint training uses a soft-label distillation method, which uses the output probability distribution of the teacher model in the form of soft labels as the learning objective of the student model. In the overall interaction process, the output of the teacher model is converted into a soft probability distribution through a Softmax function with a temperature parameter. The output of the student model is also softened. The Kullback-Leibler divergence between the two is calculated as the loss term. In the training framework, the gradient is calculated and the weights of the student model are updated using an automatic differentiation mechanism. The rotating target detection task is decoupled into four sub-tasks, each undergoing knowledge distillation. Specifically, for the classification task, the framework combines cross-entropy loss with KL divergence to make the student model's classification probability distribution approximate the teacher model's. The data interface used is the probability distribution of the classification output tensor. For the localization task, the training framework uses distributed focus loss (DFL) to model regression prediction as a probability distribution. KL divergence is used to align the localization probability distributions of the student and teacher models to improve the student model's bounding box regression capability. The data interface used is the discrete probability distribution tensor output by the localization branch. For the angle prediction task, the training framework uses circular smoothing labels to transform angle prediction into a classification problem. Combining cross-entropy loss and KL divergence improves the student model's ability to accurately predict the target's rotation angle. The data interface used is the probability distribution tensor output by the angle classification. For the label assignment task, the training framework calculates the dynamic alignment score for each anchor point, obtains the probability distribution through Softmax normalization, and uses KL divergence to align the anchor point assignment probability distribution to ensure the student model's anchor point assignment strategy is consistent with the teacher model. The data interface used is the probability distribution tensor of the dynamic alignment score.
5. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 2, characterized in that: Step S1 includes the following steps; Step S11: Collect readily available and abundant modal image object detection datasets to construct 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 anchorless FCOS idea to predict four position offsets l, t, r, b, and applies distributed focus loss to transform the Dirac distribution of the bounding box into a probability distribution; in addition, the localization branch uses circular smooth labels to transform angle prediction into classification prediction, and unifies the paradigm of the subtask head to predict soft distribution; Step S12: Adjust the model structure using neural network search, and adjust the number of convolutional 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 the inference speed requirements of edge devices. Step S13: Construct a rotating bounding box task alignment allocation mechanism to coordinate the classification confidence, regression quality, and angle prediction of anchor point prediction. Specifically, during label allocation, 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 μ. This weighting method is represented by s, and expressed by the formula: S=c α ×μ β ×w γ Where s represents the classification score of the multi-task decoupling head, which is the highest classification score among the anchor points in the multi-class classification, representing the overall classification confidence; μ represents the generalized intersection-over-union score of the rotating 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 algorithm flow is as follows: Let each anchor point in the input feature map predict the class score s, localization score μ, and angle score m of the rotation box. First, predict the class score, localization score, and angle score of the rotation box for each anchor point. Next, calculate the alignment score of each feature map grid point. 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 top K as positive samples based on the size of the alignment score. Finally, normalize the alignment scores of these positive samples for subsequent loss function calculation. 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 phase, the student network and teacher network are trained independently under full supervision, using only the rotated target labels from step S11, without joint training. Step S15: Construct a task-oriented decoupled knowledge distillation framework. By explicitly decomposing four sub-tasks—target classification, position regression, orientation rotation, and label assignment—it achieves efficient knowledge transfer from a complex, high-performance model to a lightweight model. This framework uses the pre-trained weights from the first stage as the initial weights of the teacher network. In the second stage, it uses a joint training strategy to train the teacher network using the logistic regression output of the teacher network. In the four tasks, it utilizes the soft distribution knowledge of the teacher network, namely, classification, localization, label assignment, and angle.
6. The cross-platform lightweight model rotation target recognition system for end-to-end model deployment according to claim 5, characterized in that: In step S15, for the classification task, the output labels of the teacher model and the student model are represented as follows: These output labels are transformed into a probability distribution using a softmax function with a temperature parameter τ. and In this process, the student model needs to minimize the loss function, including binary cross-entropy (BCE) and KL divergence, to improve the accuracy and consistency of predictions. During knowledge distillation, only the weight parameters of the student model are updated, while the weights of the teacher model remain unchanged to ensure training stability, as expressed by the formula: For the localization task, the four outputs (l, t, r, b) of the regression prediction are modeled as a general probability distribution and transformed into a discrete probability distribution using the DFL detector head. The output of the localization branch is aligned with the classification branch before decoding, allowing the knowledge distillation method to be extended from image classification to localization prediction, improving the model's ability to recognize the location of objects in the environment. The student model and the teacher model use the same bounding box. The four variables predicted the soft labels of DFL as follows: S reg and T reg ;pass S oftmax is transformed into a probability distribution and The Kullback-Leibler (KL) divergence is used to evaluate the similarity between two distributions, expressed by the formula: In the angle distillation task, a Softmax function with a temperature parameter is used to soften the output distributions of the teacher and student models, making the probability distributions more informative. This allows the student model to improve detection accuracy by jointly learning from the teacher model and the ground truth labels. In the angle distillation process, the directional branch outputs of the student and teacher models, i.e., the angle soft labels, are used... Represents; θ class The number of angular classifications 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 as follows: In this setting, θ class It indicates a smooth, round label, while L CE and L KL They refer to cross-entropy loss and KL divergence, respectively; λ θ It is a coefficient used to reconcile these two losses, and the distillation process is only performed on the positive sample regions selected from the label assignment; The label assignment task achieves spatial alignment by reducing the difference in the distribution of dynamic alignment metric scores between two models at the instance level. The label assignment distillation method uses the distribution of dynamic alignment coefficients for each anchor point within a single truth box as a benchmark and performs alignment by forcibly constraining these distributions in both the teacher and student models. This enhances the consistency between the teacher model's soft labels and the true labels during training, improving the model's accuracy and robustness in practical applications. This can be expressed as: For a specific instance located at position j, the total number of anchor points within the instance's truth box is defined as N. j For the i-th anchor point of this instance, the alignment score of the student model is represented as: The alignment score of the teacher model for the same anchor point is represented as... To address the consistency issue in alignment distribution, the Softmax function is used to normalize the dynamic alignment scores of all anchor points within an instance, thereby obtaining the probability distribution of label assignment. These normalized scores are defined as follows: and Mask-Softmax is employed to eliminate interference from anchor point assignments outside the ground truth boxes, and a normalization process is implemented to mitigate the impact of instance size and dynamic alignment scores on the results. The loss function is defined by minimizing the KL divergence of the label assignment distributions between the teacher and student models, and is expressed as follows: The multi-task knowledge distillation process involves four parts: position regression, category classification, angle localization, 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 training progresses, the performance of the student model gradually approaches that of the teacher model, at which point the assistance from supervised constraints becomes more significant. In this process, the second-stage training strategy emphasizes joint training, where the weights of the student model are derived from the model trained under full supervision in the first stage. This stage also introduces stronger data augmentation techniques to further improve the model's generalization ability. Meanwhile, the weights of the teacher model are frozen in the second-stage training to ensure their stability and focus on guiding the learning of the student model.
7. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 6, characterized in that: Step S2 includes the following steps; Step S21: Export the lightweight student model after joint training in S15 using the ONNX intermediate format to convert the lightweight student model into a hardware platform-independent intermediate representation. Step S22: Align the intermediate representations obtained in S21 with weights. Recursively query the weights of the intermediate representations of the model to find the absolute and relative number of weight tensors of a certain operator that exceed the representation range. At the same time, use the weight distribution to evaluate the representation quality of the weight tensors of different operators under a specific data format. Adjust the highest representation precision of some operators according to the actual position of some operators. Step S23: Determine the inference platform and framework of the target to ensure that the model executes correctly in full-precision and half-precision inference formats; This step focuses on the intermediate activation tensors generated by the model during inference to ensure activation alignment across multiple platforms. As the baseline framework, ONNXRuntime is selected as the main inference engine, and all model output levels use FP32 precision to reduce the accuracy difference between deployed and trained models. ONNX extracts 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 type. Subsequently, the framework will convert the adjusted ONNX model to adapt to different inference frameworks and convert it into an executable format for the target platform; in terms of data input, the benchmark framework will pre-compute and store the tensor data of all output nodes. During the alignment process, the system automatically assigns the pre-stored input tensors to the frames to be aligned based on the input node names, and identifies problem operator nodes by comparing the outputs of the baseline and inference frames layer by layer; the alignment baseline frame automatically performs model shape inference, automatically generates input tensors for the frames to be aligned and the baseline frame, and ensures correctness by comparing the output tensors layer by layer. By using full-node output or a coarse-grained method based on operator type, the range or type of operators that may have accuracy issues can be quickly located. After identifying potential problematic operators, switch to a finer granularity level—directly specifying the operator name—for detailed analysis and verification. This avoids manually specifying a large number of operator names in the early stages and effectively reduces the debugging workload by quickly narrowing down the problem range through coarser granularity. Fine third-level granularity positioning ensures accurate diagnosis and resolution of problematic operators, avoiding misdiagnosis and omission. 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 inference according to the 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; A cross-platform alignment method using intermediate activation tensors effectively identifies and addresses potential accuracy issues, ensuring consistent performance of lightweight models across different inference environments.
8. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 7, characterized in that: Step S3 includes the following steps; Step S31: Determine the multiple inference platforms to be deployed, pre-install all dependent files and intermediate representation files after precision alignment in step S23, and pre-compile a calibration table for low-precision quantization using the intermediate representation in the development platform. Input real data into the intermediate representation to obtain the histogram distribution data of most tensors. Package the above three files into a container to reduce the difficulty of reproducing the deployment environment. Step S32: Based on different computing platforms, deploy the container from step S31 to the specified platform, use the intermediate representation, calibration set dependency file, call the model quantization toolchain of the corresponding inference framework, generate model weights in three inference formats: FP32, FP16 and INT8 respectively, and perform automatic inference optimization using the inference platform according to the hardware structure characteristics of the platform, and store the weights of different precision formats of multiple inference platforms inside the container. Step S33: Run the service on the specified platform to access the visualization system.
9. The cross-platform lightweight model rotation target recognition system with end-to-end model deployment according to claim 8, characterized in that: In step S33, the specified platform includes Nvidia Xavier. The visual intelligence system uses the Grado front-end interactive interface to reduce environment dependence. The user first selects a supported inference framework through a drop-down menu. After selection, another drop-down menu will automatically update the model weight precision options based on the inference formats and precision 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 information on unsupported inference formats. For different access methods, if it's an embedded client, the system automatically detects the current hardware and uses pre-written C++ real-time inference logic for dynamic binding to achieve efficient inference; if it's a web client, the system uses FastAPI 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 the 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 the original image 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 coordinates of the object and its visualized image.
10. The cross-platform lightweight model rotation target recognition system for end-to-end model deployment according to claim 8, characterized in that: When the cross-platform lightweight model rotating target recognition system is used on a satellite, preliminary data processing and target recognition are completed on the satellite end; that is, a student model optimized by knowledge distillation is run on the satellite platform to achieve efficient rotating target detection. 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 UAV flight to ensure mission timeliness. It reduces computational and energy consumption burden by using a lightweight student model on the UAV body and can be quickly deployed on different types of UAV platforms through the UAV's full-link model.
Citation Information
Patent Citations
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