A multi-sensor AI model training and embedded deployment method and system

By integrating multi-sensor AI model training and embedded deployment methods and systems that integrate data acquisition, model training, and deployment, this approach addresses the challenges of high technical barriers, lack of practical tools, and high equipment costs associated with AI education tools and platforms, enabling efficient and reliable AI model training and deployment on embedded devices.

CN122173102APending Publication Date: 2026-06-09MATATALAB CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MATATALAB CO LTD
Filing Date
2026-03-06
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing AI education tools and platforms suffer from high technical barriers, a lack of practical tools, high equipment costs, and limited educational effectiveness, making it difficult for non-professional developers to develop and popularize AI in smart hardware.

Method used

This paper provides a method and system for training and embedding multi-sensor AI models based on TensorFlow. It integrates the entire process of data acquisition, model training and deployment, reduces the technical threshold through intelligent support, adopts multi-sensor type support and integrated deployment architecture, automatically selects model training strategies and lightweight model generation, and provides an end-to-end visualized process.

Benefits of technology

It enables efficient and reliable AI model training and deployment on resource-constrained embedded devices, lowers the technical threshold, improves development efficiency and consistency, provides a complete end-to-end solution, and ensures data privacy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173102A_ABST
    Figure CN122173102A_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-sensor AI model training and embedded deployment method and system, the system includes: request monitoring module, parameter verification module, task scheduling module, execution engine module, model training module, storage management module, model deployment module;The method comprises: back-end service receives the model training request initiated by client, and verifies the legality and parameter integrity of the request;In distributed cache, whether the lock mark corresponding to unique fingerprint exists is inquired;The task context of this time is distributed to independent sub-process or work thread, according to the preset sensor type-model training strategy mapping table, different types of sensor data are routed to the corresponding model training strategy;After model training is completed, model file and evaluation report are output to storage backend, and back-end service receives the model deployment request initiated by client, and client issues model file and deployment metadata to deployment equipment, to provide intelligent support for model construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an AI model training and embedded deployment method and system, and more particularly to a multi-sensor AI model training and embedded deployment method and system based on TensorFlow, belonging to the fields of smart hardware AI technology and artificial intelligence education. Background Technology

[0002] With the rapid popularization of smart hardware such as smart homes, industrial sensors, and wearable devices, AI capabilities have become their core function. Meanwhile, the demand for AI education in primary and secondary schools and higher education institutions worldwide is growing significantly, but the practical application aspect of education is weak, and students lack hands-on opportunities. This contradiction stems from the multiple technical hurdles in developing AI for smart hardware: it requires mastery of interdisciplinary knowledge such as deep learning, embedded development, and sensor technology, making it difficult for non-specialist developers to get started, thus posing a challenge to widespread education.

[0003] Specifically, AI education faces multiple bottlenecks: 1) High technical barriers: Traditional AI development relies on programming languages, resulting in high learning costs for non-professional developers and limiting the technology's widespread adoption. 2) Lack of practical tools: Existing teaching tools primarily focus on theoretical explanations and lack experimental platforms integrated with smart hardware, preventing students from experiencing the entire process from data collection to model deployment. 3) High equipment costs: Professional AI development kits are expensive, discouraging schools from purchasing them and hindering large-scale educational applications. 4) Limited educational effectiveness: Weak practical components lead to a disconnect between students' theoretical knowledge and practical applications, affecting the quality of AI talent cultivation.

[0004] Despite the progress made by existing technologies, significant limitations remain: A) AI training frameworks: Frameworks like TensorFlow / Keras and PyTorch are powerful, but require writing code to build and train models, making them unfriendly to non-professional developers. B) Embedded AI inference frameworks: LiteRT and PyTorch Mobile support model deployment, but require manual quantization and format conversion, which are error-prone and inefficient. C) Cloud AI platforms: Google AI Platform and AWS SageMaker provide one-stop services, but rely on cloud connections and cannot meet the low-latency requirements of edge computing. D) Fragmented toolchain: Existing tools do not form a closed loop, requiring developers to switch between multiple platforms, resulting in low development efficiency and poor compatibility.

[0005] Therefore, there is an urgent need to develop an innovative solution that can overcome the above-mentioned technical limitations. Summary of the Invention

[0006] To address the aforementioned existing technical problems, this invention provides a method and system for training and embedding multi-sensor AI models based on TensorFlow. By integrating the entire process of data acquisition, model training, and model deployment, it aims to lower the technical threshold and improve development efficiency, providing intelligent support for model building.

[0007] To achieve the above technical objectives, firstly, this invention provides a method for training and embedding a multi-sensor AI model, comprising the following steps: The backend service receives model training requests initiated by the client and verifies the legality of the request and the completeness of the parameters; When the verification result indicates that the request is valid, the user's unique identifier and the project's unique identifier are concatenated into a unique fingerprint for this task, and the lock flag corresponding to the unique fingerprint is checked in the distributed cache. If the lock flag exists, it is determined that there is an active task and a conflict response is returned to the client. Otherwise, it is determined that there is no active task, the lock flag is written to the distributed cache, and the task log is initialized. The task context is distributed to independent subprocesses or worker threads, the sensor data types are identified, and different types of sensor data are routed to the corresponding model training strategies according to the preset sensor type-model training strategy mapping table. After the model training is completed, the model file and evaluation report are output to the storage backend, the task status in the distributed cache is updated, the lock is released, and the child process or worker thread is destroyed. The backend service receives the model deployment request initiated by the client and returns the model file and deployment metadata to the client. After the client establishes a connection with the deployment device, it sends the model file and deployment metadata to the deployment device to complete the embedded deployment.

[0008] A further step in the method of the present invention is to verify the legality and parameter integrity of the request, which includes the following steps: Verify whether the request message contains required fields; the required fields include user unique identifier, project unique identifier, training label set, and sensor type. If any required field is missing, the request is deemed invalid and an error response is returned to the client; otherwise, the request is deemed valid.

[0009] In a further step of the method of the present invention, the identification of sensor data types, based on a preset sensor type-model training strategy mapping table, routes different types of sensor data to corresponding model training strategies, including the following steps: The sensor type is identified by the sensor_type identifier, and the value of sensor_type is read from the context of this task. When sensor_type=1 or 4, it indicates that the sensor type is distance / displacement type, and distance / displacement type sensor data executes the time series model training sub-process; when sensor_type=3, it indicates that the sensor type is illumination type, and illumination type sensor data executes the spectrum / cepstrum model training sub-process; when sensor_type=2, it indicates that the sensor type is acoustic type, and acoustic type sensor data executes the spectrum / cepstrum model training sub-process; when sensor_type=5, it indicates that the sensor type is image type, and image type sensor data executes the image model training sub-process.

[0010] Specifically, the method of this invention involves executing an image model training sub-process using image sensor data, including the following steps: The target category image index is obtained from the storage backend, the image stream is traversed and downloaded, and decoding and normalization preprocessing are performed to obtain valid samples; Verify the number of valid samples; if the number is 0, trigger exception handling and terminate the process; if the number is 1, copy the valid samples to continue training and divide the valid samples into training set and test set; if the number is ≥2, directly divide the valid samples into training set and test set. Load a pre-built lightweight convolutional neural network as the backbone network of the model and freeze the feature extraction layer; add a global average pooling layer, a Dropout layer, and a fully connected classification layer to the output of the backbone network in sequence; use the training set to perform backpropagation training on the fully connected classification layer, and write the current performance indicators to the distributed cache in real time through a callback function so that the front-end interface can display the training progress and performance indicators, thus obtaining a floating-point model. Representative samples are randomly selected from the training set to statistically analyze the distribution range of activation values ​​in each layer of the model and construct quantization calibration data. The floating-point model is then subjected to full integer quantization using the quantization calibration data to generate a lightweight inference model file for the edge. The quantized model is then tested for inference using the test set to calculate the model's performance metrics and generate a confusion matrix visualization chart.

[0011] Furthermore, the method of the present invention further includes the following steps in dividing the effective samples into a training set and a test set: Let the total number of samples be N and the number of categories be C. First, calculate the test set size test_size = max(1, int(0.2 × N)). Then, determine whether the stratification condition C > 1 and the number of samples in each category is ≥ 2. If it is satisfied, then the test set size test_size = max(test_size, C), and stratified sampling is used to divide the valid samples into the training set and the test set according to the preset ratio. Otherwise, non-stratified sampling is used to divide the valid samples into the training set and the test set. When using stratified sampling, if the test set size test_size ≥ N, then adjust the test set size test_size = N-1 and the training set size train_size = N-test_size; if stratified sampling fails, then use non-stratified sampling, and the test set size is test_size = min(N-1, max(1, C)). After completing stratified sampling, if the test set is found to be empty, a sample is taken from the training set and moved to the test set.

[0012] Specifically, the method of this invention involves a sub-process for training a spectral / ceptospectral model using the acoustic sensor data, which includes the following steps: The system retrieves the original audio waveform data of the target category from the storage backend; performs time-domain pre-emphasis and fixed-frame-length segmentation on the waveform data to obtain frame-by-frame data; performs windowing and fast Fourier transform on the frame-by-frame data to obtain the frequency domain energy spectrum; maps the frequency domain energy spectrum to the Mel scale and extracts the Mel frequency cepstral coefficients. For each sliding window segment, the MFCC frame sequence is subjected to cepstral mean-variance normalization to obtain standardized MFCC feature data; the standardized MFCC feature matrix is ​​flattened into a one-dimensional feature vector and used as sample data, and divided into training set, validation set and test set according to a preset ratio; For the two-dimensional feature map obtained by reshaping the one-dimensional feature vector within the model, a convolutional neural network containing convolutional layers and max pooling layers is constructed; the convolutional neural network model is iteratively trained using training set data, the model parameters are optimized through backpropagation, and the convergence trend of the loss function is monitored in real time to obtain a floating-point model; Perform full integer quantization on the floating-point model to generate an edge inference file in a lightweight inference model format.

[0013] Specifically, the method of this invention includes a time-series model training sub-process for the distance / displacement sensor data, comprising the following steps: The system retrieves raw sample data of the target category from the storage backend and forms a one-dimensional time-series data stream; it sets the time-domain sliding window length and sliding step size according to the configuration parameters, and calculates the number of sampling points contained in each window based on the sensor sampling rate; Starting from the beginning of the time-series data stream, the first data segment is extracted according to the window length. Then, the window is moved on the time axis according to the sliding step size, and each time a data segment of the window length is extracted as an independent training sample. If zero padding is enabled, the extraction stops when the remaining length is insufficient and exceeds the threshold. If zero padding is disabled, the subsequent data segments are discarded directly when the remaining length is reached. Verify whether the sample length reaches the expected number of sampling points; if zero padding is enabled: when the sample length is insufficient but meets the padding threshold, zero padding is performed at the end of the insufficient data segment until the standard input dimension is reached; when the sample length is insufficient and exceeds the padding threshold, the insufficient data segment is discarded directly; if zero padding is disabled: the insufficient data segment is discarded directly. The fixed-length data segments that have been verified and completed are converted into one-dimensional feature vectors and added to the sample set; the number of samples of each category in the sample set is counted, the proportion of each category is calculated, and the sample set is divided into training set, validation set and test set according to the proportion of each category. For one-dimensional time-series data streams, a multilayer perceptron fully connected network consisting of an input layer, at least one hidden layer, and an output layer is constructed. The MLP model is iteratively trained using a hierarchical training set, and the neuron weights are optimized in real time through backpropagation. The convergence of the loss function is verified simultaneously to obtain a floating-point model. Perform full integer quantization on the floating-point model to generate an edge inference file in a lightweight inference model format.

[0014] Secondly, the present invention also provides a multi-sensor AI model training and embedded deployment system for executing the multi-sensor AI model training and embedded deployment method, including a request listening module, a parameter verification module, a task scheduling module, an execution engine module, a model training module, a storage management module, and a model deployment module; The request listening module is used for: receiving model training requests initiated by the client by the backend service; The parameter verification module is used to: verify the legality of the request and the integrity of the parameters; The task scheduling module is used to: when the verification result is that the request is valid, concatenate the user's unique identifier and the project's unique identifier into a unique fingerprint for this task, and query the distributed cache to see if the lock mark corresponding to the unique fingerprint exists; if the lock mark exists, it is determined that there is an active task and a conflict response is returned to the client; otherwise, it is determined that there is no active task, the lock mark is written into the distributed cache, and the task log is initialized. The execution engine module is used to: distribute the current task context to independent child processes or worker threads; The model training module is used to: identify sensor data types and route different types of sensor data to corresponding model training strategies according to a preset sensor type-model training strategy mapping table. The storage management module is used to: after the model training is completed, output the model file and evaluation report to the storage backend, update the task status in the distributed cache, release the lock flag, and destroy the child process or worker thread; The model deployment module is used for: receiving a model deployment request initiated by the client and returning the model file and deployment metadata to the client; after the client establishes a connection with the deployment device, sending the model file and deployment metadata to the deployment device to complete the embedded deployment.

[0015] In summary, the multi-sensor type support and integrated deployment architecture of this invention integrates the entire process of data acquisition, model training, and model deployment. While ensuring performance, it also takes into account various technical requirements such as technical independence, real-time performance, and resource constraints, providing an efficient, reliable, and easy-to-use solution for AI development of smart hardware.

[0016] 1. Select appropriate model training strategies based on sensor type. Not only are preprocessing pipelines designed for different types of sensor data, implementing ToF, audio, light, and image sensor data processing algorithms, but corresponding neural networks are also automatically constructed for different types of sensor data. Through the automatic definition, configuration, and optimization methods of TensorFlow / Keras network layers, combined with network architecture selection and parameter tuning algorithms corresponding to different types of sensor data, an automatic selection mechanism for lightweight MLP, small CNN, and MobileNet transfer learning is realized, providing intelligent support for model construction.

[0017] 2. For resource-constrained embedded devices, the system generates unified deployment metadata (including tensor shape, quantization parameters, category, and sampling configuration) through automatic conversion from TensorFlow / Keras to TensorFlow Lite and INT8 quantization calibration technology to guide device-side inference. At the same time, it utilizes the consistency evaluation and resource metric recording functions of the lightweight inference engine, as well as the automated deployment metadata generation implemented by the ModelDataBuilder class, to ensure the efficient operation of the model on embedded devices.

[0018] 3. By encapsulating complex AI technologies in a web interface and designing a visual interaction, we achieve an end-to-end visual process from data acquisition to model deployment. We provide an integrated technical solution for real-time training monitoring, performance evaluation, and deployment management, as well as a three-step navigation interface operation (select model → acquire data → train and deploy), which significantly reduces the technical threshold.

[0019] Compared with the prior art, the technical advantages of the present invention are as follows: A. Technology Integration: Provides a complete end-to-end solution. The unified development environment and streamlined processing mechanism effectively avoid the complexity of integrating multiple tools, significantly improve development efficiency and consistency, and reduce manual operation and error probability.

[0020] B. Technological Autonomy: The deep application of the open-source TensorFlow framework and the fully localized deployment not only protect data privacy and security, but also make the technical solution completely controllable, support deep customization and optimization, and avoid dependence on commercial platforms.

[0021] C. Ease of use: This is reflected in the zero-code visual development environment. The integrated operation interface simplifies the complex AI development process, and the real-time status feedback provides users with an intuitive development experience, greatly reducing the technical threshold. Attached Figure Description

[0022] Figure 1 This is a general flowchart of the method of the present invention; Figure 2 This is a sub-flowchart of image model training in the method of the present invention; Figure 3 This is a sub-flowchart of the spectral / ceptorical model training in the method of the present invention; Figure 4 This is a sub-flowchart of the time series model training in the method of the present invention; Figure 5 This is a schematic diagram of the model selection interface in the system of the present invention. Figure 1 ; Figure 6 This is a schematic diagram of the model selection interface in the system of the present invention. Figure 2 ; Figure 7 This is a schematic diagram of the model selection interface in the system of the present invention. Figure 3 ; Figure 8 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 1 ; Figure 9 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 2 ; Figure 10 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 3 ; Figure 11 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 4 ; Figure 12 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 5 ; Figure 13 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 6 ; Figure 14 This is a schematic diagram of the data acquisition interface in the system of the present invention. Figure 7 ; Figure 15 This is a schematic diagram of the training model interface in the system of the present invention. Figure 1; Figure 16 This is a schematic diagram of the training model interface in the system of the present invention. Figure 2 ; Figure 17 This is a schematic diagram of the training model interface in the system of the present invention. Figure 3 ; Figure 18 This is a schematic diagram of the training model interface in the system of the present invention. Figure 4 ; Figure 19 This is a schematic diagram of the model deployment interface in the system of the present invention. Figure 1 ; Figure 20 This is a schematic diagram of the model deployment interface in the system of the present invention. Figure 2 ; Figure 21 This is a schematic diagram of the model deployment interface in the system of the present invention. Figure 3 ; Figure 22 This is a schematic diagram of the model deployment interface in the system of the present invention. Figure 4 ; Figure 23 This is a schematic diagram of the model deployment interface in the system of the present invention. Figure 5 . Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with the embodiments of this invention. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. In the description of this application, terms such as "connection" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0024] Example 1: As Figure 1 As shown, this embodiment provides a method for multi-sensor AI model training and embedded deployment, including the overall process of scheduling AI model training tasks based on the cloud (or locally, note: it also supports desktop programs running offline locally), and the specific steps are as follows: S100, Start: The system initializes, the backend service (Web API service) starts, and listens for predefined RESTful API interfaces (such as the / v1 / train interface), waiting for model training requests initiated by clients (such as PC browsers or mobile apps).

[0025] This step ensures component readiness through a service process daemonization mechanism, and uses a TCP / IP protocol stack to listen on the port for client connections, thereby establishing the basic operating environment for the system and preparing it to receive external requests.

[0026] S101. Receiving Model Training Requests from Clients: The backend service (Web API service) receives HTTP POST requests from clients (such as PC browsers or mobile apps) through a predefined RESTful API interface (e.g., / v1 / train interface). The request payload contains training parameters for this training task, such as user ID, project ID, training label set, sensor type, training hyperparameters, data processing and window parameters, and scene-specific parameters.

[0027] This step leverages the stateless nature of the HTTP protocol to support cross-platform (PC browser, mobile app) requests, thereby standardizing external access methods.

[0028] S102. Verify the legality and completeness of the request: Parse the received request message and verify whether it contains the required fields. The required fields include: User ID, Project ID, Training Label IDs, and Sensor Type. If the verification finds that any required field is missing (such as the Sensor Type), the model training request will be deemed invalid, and the process will proceed to step S103; otherwise, the model training request will be deemed valid, and the process will proceed to step S104.

[0029] This step filters invalid requests based on predefined parameter validation rules, thereby preventing subsequent processes from becoming abnormal due to missing parameters and reducing the resource consumption of the system in processing invalid data.

[0030] S103. Return an error response: Directly return an HTTP 400 Bad Request status code and error description to the client (such as a PC browser or mobile APP) and terminate the current processing.

[0031] This step sends error information to the client via status codes and description text, thereby quickly terminating illegal requests, reducing unnecessary process overhead, and improving client debugging efficiency.

[0032] S104. Generate a unique fingerprint for the task and check the distributed lock status: Concatenate the user ID and project ID (e.g., training: lock: {user_id}: {project_id}) to generate a unique fingerprint for this training task. Then, access the distributed cache (e.g., Redis) to query whether the lock token corresponding to the unique fingerprint exists.

[0033] It's important to note that in distributed systems, Redis key-value pairs (e.g., training:lock:user123:proj456) can be used as lock markers to ensure that the same resource is operated on by only one thread at a time. Key-value pairs are the basic form of data storage in distributed caches (such as Redis), consisting of a unique key and a corresponding value. In task scheduling, the key is usually a unique fingerprint of the task (e.g., user_id:project_id), and the value is the lock status (e.g., 1 indicates locked, 0 indicates unlocked). Atomic operations on key-value pairs (e.g., SET NX) can achieve distributed lock control across service nodes. Even if the service crashes or other anomalies occur, the lock will be automatically released after 2 hours.

[0034] This step utilizes a distributed cache to implement a locking mechanism across service nodes, preventing concurrent conflicts and ensuring that training tasks for the same user and the same project are executed serially, thus avoiding resource contention and data overwriting.

[0035] S105. Does an active task lock exist? Determine the query result of step S104. If the key-value pair of the unique fingerprint already exists in the distributed cache, it is determined that there is an active task and proceeds to step S106; otherwise, there is no active task and proceeds to step S107.

[0036] It's important to note that an active task lock refers to a lock flag that is currently in effect, indicating that the corresponding resource is being used. In training task scheduling, the existence of a specific key-value pair (e.g., training:lock:user123:proj456=1) is checked in a distributed cache (such as Redis) to determine if an active task lock exists. If it exists, it means that the user's project already has a training task being executed, and duplicate submissions should be avoided. An active task is a training task that is currently being executed but not yet completed, directly identified by an active task lock. For example, when a user submits a training request, a task lock is generated and marked as active; at this point, the task is an active task until it is completed and the lock flag is released.

[0037] This step, based on the existence of key-value pairs and combined with the lock's TTL (2 hours) automatic release mechanism, avoids deadlocks and serves as the core judgment node for task concurrency control, determining the subsequent process flow.

[0038] S106. Return Conflict Response: If an active task lock exists, it means that the previous training task for this project has not yet ended. Reject duplicate submissions and return an HTTP 409 Conflict status code and prompt (such as "The training task for this project is already running") to the client, informing the client that the resource is temporarily unavailable to prevent resource contention and data overwriting.

[0039] S107. Lock resources and initialize task logs: If no active task lock exists, immediately write the lock marker with the unique fingerprint to the distributed cache and set a 2-hour expiration time (TTL). At the same time, clear the old historical logs of this project and write an initial log entry of "Task created".

[0040] This step ensures exclusivity through distributed locks, and guarantees atomicity for log initialization through database transactions (such as DELETE + INSERT in MySQL), thereby preempting task execution rights and providing traceable log records for subsequent processes.

[0041] S108. Distribute the task context to independent execution units: The main service process does not directly execute time-consuming training calculations. Instead, it encapsulates the task context (Context) containing all training parameters (including unique fingerprint, sensor type, data path, etc.) and submits it to the backend asynchronous task execution engine (Executor). The execution engine then distributes the task context (Context) to independent child processes or worker threads according to the current load.

[0042] This step decouples task submission and execution through message queues, supports load balancing, and thus isolates the main service from the computing tasks, avoiding the blocking of backend service (Web API service) responses during training time.

[0043] S109. Identify sensor data types: In an independent subprocess or worker thread, read the "sensor type" field in the task context (Context) training parameters so as to route different types of sensor data to the corresponding model training strategies according to the preset sensor type-model training strategy mapping table.

[0044] Specifically, the sensor type is identified by the sensor_type, and the value of sensor_type in the current task context is read. When sensor_type=1 or 4, it indicates that the sensor type is distance / displacement type (such as ToF sensor). Distance / displacement sensor data executes the time series model training sub-process, and then proceeds to step S110C. When sensor_type=3, it indicates that the sensor type is illumination type (such as light sensor). Illumination sensor data executes the spectrum / cepstrum model training sub-process. When sensor_type=2, it indicates that the sensor type is acoustic type (such as audio sensor). Acoustic sensor data executes the spectrum / cepstrum model training sub-process, and then proceeds to step S110B. When sensor_type=5, it indicates that the sensor type is image type (such as camera). Image sensor data executes the image model training sub-process, and then proceeds to step S110A.

[0045] This step routes data from different sensor types (such as ToF sensors, audio sensors, light sensors, cameras, etc.) to time-series model training sub-processes, spectral / cepstrum model training sub-processes, or image model training sub-processes based on the parameters of the sensor type. This achieves automated adaptation of "data-processing-modeling," thereby completing model training based on the pre-processed data and improving model accuracy and efficiency.

[0046] S111. Output the trained model and evaluation report to the storage backend: After training is complete, the generated model file (e.g., .tflite format) and an evaluation report (JSON format) containing metrics such as accuracy and confusion matrix are written to the preset storage backend (including local file system or cloud object storage service), and the task status is updated; then the task lock and execution resources are released. The frontend obtains all information through an interface request.

[0047] This step utilizes a cloud-based object storage service (OSS) to persistently store the model results, providing clients with access for querying and downloading. Clients, in turn, store the files locally on their computers.

[0048] S112. Release the task lock and destroy the execution unit: Regardless of whether the training task succeeds or fails, a cleanup callback will be triggered, deleting the lock marker of the unique fingerprint of this training task from the distributed cache (such as Redis), allowing the project to submit new training tasks again. At the same time, to prevent memory leaks, the child process executing this training task is destroyed and recycled.

[0049] It should be noted that when a lock marker corresponding to a fingerprint is detected (i.e., the key-value pair is valid in the distributed cache), the task corresponding to that fingerprint is determined to be an "active task," and new duplicate requests will be rejected (returning an HTTP 409 conflict response). Only after the task has been executed and the lock marker has been released (the key-value pair has been deleted) can a new task be submitted.

[0050] This step triggers cleanup logic via a callback function to ensure that resources are released regardless of whether training is successful or not, thereby unlocking resources, allowing new tasks to be submitted, and preventing zombie processes from occupying system resources.

[0051] S113, Model Deployment: After all computational processes for a single model training task are completed, the system enters the "Waiting for Deployment Request" state, waiting for the client to initiate a model deployment request. The backend service (Web API service) receives the model deployment request initiated by the client and returns the model file and deployment metadata to the client. After the client establishes a connection with the deployment device, it sends the model file and deployment metadata to the deployment device, completing the embedded deployment.

[0052] Specifically, the training server is responsible for product generation, version management, and providing download interfaces. The Web API service / client is responsible for sending the model files and deployment metadata from the training server to the target device after establishing a Bluetooth / USB connection with the deployment device. Therefore, when the client initiates a model deployment request, the corresponding connection process is initiated based on the user-selected deployment method. Once the connection status and device handshake conditions are met, the client executes model delivery and result confirmation. For example, after automatically redirecting to the My AI interface, the user can select the training model to load and connect to the deployment device via Bluetooth or USB. Then, the model-related files and information are automatically downloaded to the deployment device via Bluetooth or USB, thus completing the model deployment.

[0053] In addition, such as Figure 1 As shown, steps S110A, S110B, and S110C correspond to model training strategies for different types of sensor data. Due to the significant differences in data dimensionality and distribution characteristics of different physical quantities (such as image pixels, sound wave amplitude, and TOF distance values), this invention specifically designs three parallel processing sub-processes, namely… Figures 2 to 4 The diagram illustrates the image model training sub-process, the spectral / ceptametric model training sub-process, and the time-series model training sub-process. Those skilled in the art should understand that these three sub-processes can coexist in the same system, or can be partially implemented depending on the actual application scenario. Specific details are provided in the following embodiments.

[0054] Example 2: Regarding step S110A, as follows Figure 2 As shown, the image sensor data executes an image model training sub-process, including the following steps: A201. Obtain the target category image index from cloud storage: Based on the project unique identifier (Project ID) and training label set (Label IDs), traverse the specific directory structure in the cloud object storage service (OSS) (e.g., ml / {user_id} / {project_id} / ) via API to obtain a list of all image file paths belonging to the target category.

[0055] This step uses directory prefix filtering and metadata tag filtering to locate the target file and returns a list of paths, thereby clarifying the boundaries of the training data and providing standardized input for subsequent processing.

[0056] A202. Traverse and download image streams and perform decoding and normalization preprocessing: Download the binary streams of images in the image file path list in sequence, and use the image decoding library to convert them into bitmap matrices. Then perform preprocessing: Scale the images uniformly to the standard size required for the model input (e.g., 96×96 pixels), and normalize the pixel values ​​by dividing them by 255 to map them to the floating-point range of [0, 1].

[0057] Specifically, when sensor_type=5, the image processing performed on the sample data is as follows: size standardization → pixel normalization → data augmentation (optional). First, the image data is standardized to a fixed size (e.g., 224x224) for easier subsequent processing. Then, pixel normalization maps pixel values ​​to a range of 0-1 or -1 to 1, eliminating the influence of dimensions. To enhance the model's generalization ability, data augmentation operations such as rotation, flipping, and brightness adjustment can also be performed.

[0058] This step uses image decoding libraries (such as OpenCV and PIL) to parse the format, and uses interpolation algorithms (such as bilinear interpolation) to scale and normalize to eliminate differences in pixel value dimensions, thereby unifying the data format and size and providing standardized input for model training.

[0059] A203. Verify the number of valid samples: Count the total number of successfully preprocessed image samples and determine whether the number of valid samples meets the training conditions. If the number of valid samples is 0, proceed to step A204; if the number of valid samples is 1, duplicate the sample and continue training so that it has two identical samples in the dataset to meet the basic requirements of machine learning training, and proceed to step A205; otherwise (i.e., the number of valid samples ≥ 2), directly proceed to step A205.

[0060] A204. Trigger exception handling and terminate sub-process: Record an error log for "No training data" and send a termination signal to the log queue to end the current sub-process. This step captures scenarios where the number of valid samples is 0, calls the log service to record information, triggers process interruption, and thus quickly terminates invalid tasks, reducing resource waste.

[0061] A205. Dividing the training set and test set: In specific implementation, the effective samples are divided into the training set and test set according to the following logic: Let the total number of samples be N and the number of categories be C; First, calculate the size of the test set test_size=max(1,int(0.2×N)); If N=2, then test_size = max(1,int(0.22))=max(1,0)=1.

[0062] Then determine whether the stratification condition is met: if the stratification condition C > 1 and the number of samples in each category is ≥ 2, then the test set size test_size = max(test_size, C) and stratify = y, that is, stratified sampling is used to divide the effective samples into the training set and the test set according to a preset ratio (e.g., 80% for the training set and 20% for the test set), ensuring that the proportion of samples of each category in the training set and the test set is consistent; otherwise, stratify = None, that is, non-stratified sampling is used to divide the effective samples into the training set and the test set.

[0063] Furthermore, when using stratified sampling, if the test set size `test_size` ≥ N, then adjust the test set size to `test_size` = N - 1, and the training set size to `train_size` = N - `test_size`; for example, if `test_size` = 1 and N = 2, then `test_size` = 1 and `train_size` = 1. Finally, the two samples are assigned to the training and test sets respectively, thus splitting the dataset.

[0064] When using stratified sampling, if stratified sampling fails, non-stratified sampling will be used to re-divide the valid samples into training and test sets, with the test set size `test_size = min(N-1, max(1, C))`. Specifically, the test set size is at least 1 (as ensured by `max(1, C)`), but cannot exceed N-1 (N-1 is to guarantee at least one sample in the training set). If the calculated `test_size` is greater than or equal to the total number of samples N, then `test_size` is set to N-1. This step serves as an exception handling mechanism to ensure that the dataset partitioning task can be completed even if stratified sampling fails, guaranteeing the robustness and continuity of the process.

[0065] After completing stratified sampling, if the test set is found to be empty (i.e. no samples are assigned to the test set), a sample is taken from the training set and moved to the test set to ensure that the test set contains at least one sample, thereby ensuring that the subsequent model evaluation can proceed normally.

[0066] Steps A203 to A205 above employ a defensive design involving automatic single-sample fallback and dataset splitting. If there's only one image (sample size 1), the system will attempt a "self-rescue," and the front-end page will prompt that at least two samples are required. The back-end training logic will also manually copy this single sample and add it to the dataset to meet the minimum training quantity requirement (although this is algorithmically less than ideal, it prevents exceptions). When splitting the test set, automatic degradation, a minimum test set, and secondary empty set detection are used to ensure no illegal or null values ​​are found. This design ensures that a valid training and test set is obtained under all circumstances, preventing interruptions to the training or evaluation process due to data splitting issues.

[0067] A206. Load a lightweight backbone network and freeze the feature extraction layers: Load a lightweight convolutional neural network (such as MobileNet V1 / V2) from a pre-trained model library or a custom configuration as the backbone network of the model to extract features from the input data. To speed up training and prevent overfitting on small samples, set the weight parameters of all convolutional layers in the backbone network to a non-trainable state (i.e., frozen), preventing these layers from updating their parameters during subsequent fine-tuning, and only training the newly added layers in the model.

[0068] This step calls a deep learning framework (such as TensorFlow / Keras) to load a pre-trained model, freezes the parameters of the feature extraction layer by setting trainable=False, thereby reusing pre-trained features, preventing overfitting, and improving training efficiency.

[0069] A207. Construct a global average pooling layer and a fully connected classification layer: Add a global average pooling layer, a dropout layer, and a fully connected classification layer (Dense Layer) sequentially to the output of the backbone network. The number of nodes in the fully connected classification layer (Dense Layer) is equal to the number of categories of the training target.

[0070] This step adds specific layers after the backbone network output of the deep learning model to complete the classification task. Global average pooling layers compress the spatial dimension of the feature maps while preserving channel dimension information. Dropout layers prevent overfitting and enhance the model's generalization ability by randomly deactivating some neurons. Fully connected classification layers contain a softmax activation function, mapping the compressed features to the class space. Typically, the softmax activation function is used to convert the output into probability distributions for each class, and the number of nodes matches the number of target classes.

[0071] A208. Perform iterative training and report progress via callback function: This refers to using the training set data to perform backpropagation training on newly added fully connected classification layers during model training. After each training epoch, the current loss value and accuracy, among other key performance indicators, are written to a distributed cache in real time via a callback function, so that the front-end interface can promptly display the training progress and performance metrics.

[0072] This step dynamically monitors the training process, enabling visualized monitoring and real-time debugging.

[0073] A209. Constructing Quantization Calibration Data Based on Training Set Features: After training, representative sample data is randomly extracted from the training set to construct a representative dataset, which serves as the quantization calibration data and is used to statistically analyze the distribution range of activation values ​​in each layer of the model.

[0074] Representative sample data is randomly drawn from the already trained training set. These samples need to fully reflect the input distribution characteristics of the model in real-world applications. For different types of sensor data (such as general sensor / audio acquisition), 100-200 samples are typically drawn; while for image data, the full sample size is used to ensure statistical accuracy. A calibration data generator is built to obtain quantization calibration data. This generator provides the TFLite converter with a rigorously preprocessed (such as normalization and dimensionality adjustment) real data stream, enabling the conversion engine to statistically analyze the true dynamic range of activation values ​​at each layer of the model during the conversion process through forward inference. This provides accurate statistical basis for INT8 fixed-point quantization, thereby significantly reducing quantization noise and ensuring the accuracy of the model during embedded inference.

[0075] A210. Perform full integer quantization conversion to generate the edge model: Based on the quantization calibration data, the weight parameters and activation values ​​originally represented by 32-bit floating point (Float32) in the model are mapped to 8-bit integer (Int8) format to generate an edge quantization model file suitable for embedded devices.

[0076] This step uses a linear mapping algorithm to quantize the data, converting the Float32 parameters to Int8 format and generating a lightweight inference model format (such as LiteRT, formerly TensorFlow Lite, .tflite format) model file, thereby reducing the model size and computational complexity and enabling deployment on edge devices.

[0077] A211. Evaluate the accuracy and confusion matrix metrics of the quantization model: Using the reserved test set data, perform inference tests on the edge quantization model, calculate the final accuracy, recall, F1 score and other key performance metrics, and generate a confusion matrix visualization chart.

[0078] This step involves comparing test set samples with real labels, statistically analyzing the classification results, calculating metrics, and generating a confusion matrix visualization chart as the final evaluation result of the model performance, providing a basis for deployment decisions.

[0079] Example 3: Regarding step S110B, as follows Figure 3 As shown, the acoustic sensor data undergoes a spectrum / ceptomography model training sub-process, which includes the following steps: B301. Obtain the original audio waveform data of the target category: Read the original audio PCM data belonging to the specific category from the storage backend and parse it into one-dimensional time series waveform data.

[0080] This step loads the original audio sample point sequence in PCM format (e.g., 8,000 samples per second of audio at an 8kHz sampling rate), thereby converting the audio data into numerical time series data that the model can process.

[0081] B302. Perform temporal pre-emphasis and fixed frame length segmentation: Apply a pre-emphasis filter to the waveform data to enhance high-frequency components. Then, use a sliding window to segment the long audio into short frames (e.g., frame length 20ms, step size 20ms).

[0082] The pre-emphasis in this step enhances high frequencies through differential filtering, and the frame segmentation divides the long-time signal into short-time segments (e.g., at an 8kHz sampling rate, a 20ms frame length corresponds to 160 sampling points), thereby improving high-frequency details and transforming non-stationary signals into approximately stationary short-time signals, preparing for frequency domain analysis.

[0083] B303. Perform windowing and Fast Fourier Transform on framed data: Multiply each frame signal by a Hamming window to reduce spectral leakage, and perform Fast Fourier Transform (FFT) to convert the time-domain signal into a frequency-domain energy spectrum.

[0084] In this step, the Hamming window smooths frame edges using a weighting function, reducing spectral leakage caused by signal truncation; the FFT converts the time-domain signal into a frequency-domain energy distribution, thereby extracting the frequency component information of the audio and providing a basis for extracting Mel-frequency cepstral coefficients.

[0085] B304. Mapping to Mel Scale and Extracting Cepstral Coefficients (MFCCs): For the frequency domain energy spectrum, a set of Mel filter banks is used to simulate the human ear's perception characteristics of different frequencies. Subsequently, the logarithm of the filter output is taken and a discrete cosine transform (DCT) is performed to extract the first N dimensions (e.g., 13 dimensions) as Mel frequency cepstral coefficients (MFCCs).

[0086] In this step, the Mel filter bank maps the frequency domain energy to Mel frequency, and the DCT performs an orthogonal transformation on the logarithmic energy to extract the first 13 dimensions as core features, thereby extracting features that are highly correlated with human auditory perception, reducing dimensionality and retaining key information.

[0087] B305. Perform Cepstral Mean-Variance Normalization (CMVN): Calculate the mean and variance of the MFCC frame sequence for each sliding window segment within the CMVN sliding window (win_size=101) and perform normalization to obtain standardized MFCC feature data (i.e., a two-dimensional matrix mfcc_cmvn with a shape of "frame number × 13").

[0088] This step employs cepstral mean-variance normalization (CMVN) technology, which calculates the mean and variance of audio features and performs standardization, effectively eliminating feature shifts caused by recording equipment, environmental noise, or channel differences, thereby significantly enhancing the robustness of the model under different acquisition environments.

[0089] B306. Constructing a multidimensional acoustic feature map and dividing the dataset: Flatten the standardized MFCC feature data into a one-dimensional vector and use it as sample input to divide the dataset into training, validation and test sets.

[0090] This step maintains the frame sequence structure in chronological order (the number of frames is determined by the window length and frame shift). For example, 50 frames are stitched together to form a 50×13 feature matrix, and the training set, validation set, and test set are divided according to a preset ratio (0.8 / 0.1 / 0.1) to construct a spatiotemporal feature matrix to adapt to the deep learning model. During the training process, the independent dataset division effectively monitors and avoids overfitting.

[0091] B307. Initialize the Convolutional Neural Network (CNN) structure: The input is a one-dimensional feature vector, which is then reshaped into a two-dimensional feature map within the model and convolved to construct a convolutional neural network (CNN) for the two-dimensional feature map, including convolutional layers (Conv2D) and max pooling layers (MaxPooling2D).

[0092] This step extracts time-frequency texture features through convolutional layers (Conv2D) and performs dimensionality reduction through max pooling layers (MaxPooling2D) to extract the spatiotemporal correlation of acoustic features, compress feature dimensions, and retain key information.

[0093] B308. Perform model training and verify the convergence of the loss function: Iteratively train the convolutional neural network model using the constructed two-dimensional acoustic feature map, optimize the model parameters through backpropagation, and achieve real-time monitoring of the convergence trend of the cross-entropy loss function by integrating the Redis logging system.

[0094] This step employs the Adam optimizer (learning rate set to 0.001) with the goal of minimizing the loss function. At the end of each training epoch, evaluation metrics are calculated simultaneously using the validation set. Gradient descent is used to continuously adjust the weights of the deep neural network, ensuring the model accurately learns the mapping relationship between acoustic features and class labels. Model performance during training is fed back in real time to ensure the model's generalization ability through convergence analysis, ultimately solidifying the optimal parameters.

[0095] B309. Perform model quantization to generate edge inference files: Based on the trained floating-point model, perform full integer quantization (INT8 quantization) to convert the weights and activation values ​​from 32-bit floating-point to 8-bit integers and generate inference files suitable for embedded devices (such as tflite format).

[0096] This step involves statistically analyzing the dynamic range of activation values ​​for each layer of the model using a representative dataset. Typically, 100-200 typical samples are extracted from the training set as calibration criteria. A linear quantization algorithm is employed to map floating-point parameters to integers, and the input and output are forced to be of type INT8. After quantization, the model size is compressed by approximately four times, significantly improving computational efficiency. Furthermore, through precision compensation during the calibration process, performance loss is kept to a minimum, thereby reducing model storage footprint and computational resource consumption. This adapts to the hardware limitations of edge devices (such as embedded chips and mobile devices) and meets real-time inference requirements.

[0097] It should be noted that steps B308-B309 above are logically consistent with steps A208-A210 in the image training sub-process, but the method of constructing quantization calibration data has been adjusted for the time-frequency characteristics of audio features (such as based on MFCC feature distribution rather than image pixel values) to ensure the efficiency and accuracy of the acoustic model when deployed on the edge.

[0098] Example 4: Regarding step S110C as follows Figure 4 As shown, the time-series model training sub-process for the distance / displacement sensor data includes the following steps: C401. Obtain the time-series sensor data stream of the target category: Read the original sample data of the target category (such as the distance sampling value of the TOF distance sensor, the triaxial acceleration data of the accelerometer, etc.) from the storage backend (including one or more of object storage, relational database or time-series database) to form a continuous one-dimensional time series (the sampling points are arranged in chronological order) and obtain a one-dimensional time-series data stream.

[0099] In this step, the sensor converts physical quantities (such as distance, acceleration, and temperature) into electrical signals, which are then converted into digital sample values ​​by AD conversion. These values ​​are arranged in time stamp order to form a data stream, thus providing the raw data for model training and serving as the foundation for subsequent feature extraction and model training.

[0100] C402. Set the time-domain sliding window length and sliding step: Read the time-domain sliding window length (e.g., WindowSizeMs=2000ms) and sliding step (e.g., WindowIncreaseMs=100ms) according to the configuration parameters, and calculate the number of sampling points (Input Dimension) contained in each time-domain sliding window based on the sensor sampling rate.

[0101] It should be noted that a time-domain sliding window is a technique in time series data processing that divides a continuous data stream into multiple equal-length data segments by setting a fixed-length time window and sliding it along the time axis at preset steps. Its core principle is based on the assumption that the data is time-sensitive, focusing only on the most recent data within the window. As time progresses, the window slides forward, adding the latest data and removing the oldest data, thereby dynamically capturing samples with local temporal characteristics.

[0102] This step converts an infinitely long time series data stream into finite-length samples to meet the model's input dimension requirements.

[0103] C403. Extracting data segments as single samples: Starting from the beginning of the time series data stream, extract the first data segment according to the window length; then move the window on the time axis according to the sliding step size, extracting a data segment of one window length each time as an independent training sample, until the remaining length is insufficient and exceeds the padding threshold.

[0104] Specifically, there are usually cases where the data stream is too short at the end. When this happens, the system will determine whether to retain the sample based on the padding threshold. The padding threshold is calculated by get_padding_ratio (a function that calculates the ratio to determine the maximum allowed missing ratio) based on the sample length and input_dim (the fixed dimension required by the model input layer) (it can be 1 / 0.75 / 0.5).

[0105] If zero padding is disabled (padZeros=False) and the padding threshold is 0, then data segments will be strictly truncated without zero padding, and data segments with insufficient length will be discarded. For example, if a 2000ms window and a 100ms step size are configured, and there are 200 data points in 10 seconds of data sampled at 20Hz, with a window size of 40 points and a step size of 2 points, 81 samples will be strictly truncated [(200-40) / 2 +1 = 81].

[0106] If zero padding is enabled (padZeros=True), the window is allowed to partially move out of the data boundary. If the missing amount does not exceed the padding threshold, the sample output will be increased by padding with zero values ​​at the end.

[0107] This step, during the sliding window sample extraction process, determines whether to retain a window segment based on window movement rules and padding thresholds. It's a preliminary screening process, judging whether a window can be used as a sample (even if its length is insufficient, it may be retained because it doesn't exceed the zero-padding threshold). Furthermore, the extraction process must align the sample point sequence to avoid data misalignment, thereby achieving batch extraction of data segments and ensuring the continuity and local correlation of samples over time.

[0108] C404. Verify that the sample length meets the dimensionality requirements: Check whether the length of each extracted data segment reaches the expected number of sampling points (e.g., 40 or 200 points). If the model input requires 40 sampling points, then each sample segment must contain exactly 40 points, neither more nor less, to ensure that its number of sampling points reaches the fixed length required for model training.

[0109] Specifically, when the sample length is insufficient but meets the completion threshold, that is, when the missing amount does not exceed the allowable missing amount corresponding to the threshold, the sample is considered to still have retention value, is judged as a "sample to be completed", and proceeds to step C405, where zero-filling operation is performed until the standard input dimension is reached.

[0110] When the sample length is insufficient and exceeds the padding threshold, such as when the missing amount exceeds half the window length, the data segment will be directly discarded to avoid excessive manual zero-padding signals interfering with model learning, and the process will proceed to step C406.

[0111] When zero padding is turned off (padZeros=False), data segments that are not long enough will be discarded and the process will proceed to step C406.

[0112] This step, following the initial screening, performs a final dimensionality check on the generated samples. It reconfirms whether each sample meets the minimum length requirement for model input, ensuring that all samples input into the model have uniform dimensions, thereby avoiding model training errors or feature extraction distortion due to inconsistent sample lengths.

[0113] C405. Perform zero-padding at the end of the sample based on front-end parameters: For samples with insufficient data stream length that have reached the padding threshold, only when padZeros=True will the end of the data segment be padded with zeros until the standard input dimension is reached. For example, a segment with 150 sampling points needs to be padded with 50 zeros to form a standard sample of 200 points.

[0114] In this step, zero-padding maintains the sample length by adding meaningless values ​​(0), avoiding feature loss due to truncation. Compared to forward padding (copying the last value), zero-padding has less interference with time-series trends, making it particularly suitable for non-periodic sensor data.

[0115] C406. Generate standard input vectors: Convert the validated and completed fixed-length data segments into one-dimensional feature vectors, add them to the sample set as the standard input vectors of the model, and label each vector with the corresponding category label.

[0116] This step receives a fixed-dimensional one-dimensional vector input through an MLP model. The time series data needs to be organized into a matrix format (number of samples, feature dimension) to form a structured sample set, which is directly connected to the model input layer to provide labeled supervision data for training.

[0117] C407. Statistical Class Distribution and Balanced Dataset Division: Statistically count the number of samples in each class in the sample set, calculate the proportion of each class, and divide the number of samples into training set, validation set and test set according to the proportion of each class (e.g., 0.6 / 0.2 / 0.2). At least one sample should be retained in each subset to ensure that the class distribution of the subset is consistent with the original dataset.

[0118] In this step, the hierarchical technique used to divide the training set ensures the representativeness of both the training and test sets, preventing the model from tending to predict large sample classes. This improves the model's ability to identify a few classes, ensures the representativeness of the training and test sets, and reduces evaluation bias.

[0119] C408. Constructing a Multilayer Perceptron (MLP): For low-dimensional one-dimensional time-series sensor data, construct a multilayer fully connected network (MLP) containing an input layer, hidden layers (1-2 layers), and an output layer. For example, Input layer -> Hidden layer 1 (ReLU activation) -> Hidden layer 2 (ReLU activation) -> Output layer (Softmax activation).

[0120] In this step, MLP transmits information through fully connected multilayer neurons, introduces nonlinear transformations using the ReLU activation function in the hidden layers, and finally outputs the class probability distribution through the output layer. This solves the problem that single-layer networks cannot fit complex features, thereby mapping low-dimensional time-series signals into class probabilities, adapting to the one-dimensional feature structure of sensor data, and providing a learnable model framework for subsequent training.

[0121] C409. Perform feature fitting training: Iteratively train the MLP model using the hierarchically processed training set. Optimize neuron weights in real-time using the backpropagation algorithm and simultaneously verify the convergence of the loss function to obtain the floating-point model.

[0122] This step employs the Adam optimizer (learning rate specified by the request parameter, default learning rate is 0.001) to minimize cross-entropy loss. At the end of each training epoch, the loss metric is calculated using an independent validation set, and the convergence curve is fed back in real-time via an integrated Redis logging system. The training process aims to learn the deep nonlinear mapping between sensor temporal features and class labels, ensuring the model has sufficient generalization ability while learning from historical data. Finally, the model's learning performance is determined by comparing the training loss and validation loss.

[0123] After training, C410 performs quantization on the floating-point model and exports a lightweight inference model format (such as LiteRT, formerly TensorFlow Lite, .tflite format) to adapt to resource-constrained devices.

[0124] This step involves calibrating the dataset to statistically analyze the dynamic range of activation values, mapping them to integers using a linear quantization formula. After quantization, the data size is compressed by a factor of four, improving computational efficiency and thus reducing storage and computational resource consumption, adapting to the real-time inference requirements of edge devices.

[0125] It should be noted that steps C409-C410 above are logically consistent with the training and quantization stages of the image / spectrum / ceptomography model training sub-process. The quantization calibration data construction method has been adjusted for time-series data characteristics (based on time-series feature distribution rather than specific image / spectrum / ceptomography features), ensuring efficient and accurate deployment on the edge. Furthermore, illumination sensor data can be reused in the spectrum / ceptomography model training sub-process, or enabled as a reserved extension type according to the deployment configuration.

[0126] Example 5: This example provides a multi-sensor AI model training and embedded deployment system. The system adopts a three-layer architecture design of "data acquisition layer + training processing layer + inference deployment layer", which decomposes the complex intelligent hardware AI development process into three logically clear and functionally independent layers.

[0127] Specifically, the data acquisition layer is responsible for supporting Bluetooth or USB device connections via a web interface to acquire data from various sensors in real time. It then labels the acquired data (e.g., classifying time-series data and labeling image features) to provide a labeled training set for subsequent training. The labeled data is stored in the system for further training. Here, Bluetooth refers to short-range wireless communication technology used for data transmission between mobile devices and sensors; while USB is a universal serial bus, providing a stable and reliable wired data transmission channel.

[0128] The training and processing layer, deployed on a server or PC, undertakes the core tasks of AI model building and optimization. Through training orchestration, it automatically selects the corresponding data processing algorithm (such as sliding window for ToF, MFCC for audio, and image size normalization) based on the sensor type (e.g., ToF sensor, audio sensor, light sensor, camera, etc.), achieving automated adaptation of "data-processing-modeling". Based on the preprocessed data, it completes model training (e.g., architecture selection such as fully connected networks and convolutional neural networks, and hyperparameter configuration such as learning rate and epochs). After training, it enters the quantization stage (e.g., INT8 quantization, converting the 32-bit floating-point model into an 8-bit integer model to reduce model size and inference latency); then, it verifies the accuracy and efficiency of the quantized model through consistency evaluation, ensuring that performance loss is controllable. The technology of this layer is based on the TensorFlow / Keras framework, enabling it to autonomously complete the design, parameter configuration, and optimization algorithm selection of neural networks.

[0129] The inference deployment layer focuses on performing local AI inference on embedded devices such as the ESP32. It first produces a lightweight inference model and deployment metadata (such as input / output formats and quantization parameters). Then, it synchronizes the model and metadata to the hardware device (such as the ESP32) via Bluetooth or USB deployment, completing the deployment from cloud training to edge devices. The ESP32 is a low-cost microcontroller developed by Espressif Systems that integrates Wi-Fi and Bluetooth, featuring dual-core processing power and low power consumption. This layer integrates the TensorFlow Lite runtime environment, a lightweight inference framework specifically designed for resource-constrained embedded devices.

[0130] The core advantage of this architecture lies in its separation of responsibilities, allowing each layer to focus on specific technical tasks and avoiding the complexity caused by functional coupling. By connecting the entire chain of "data acquisition → training → quantization → deployment → hardware collaboration" through process steps, it achieves end-to-end automation and technical optimization from user configuration to embedded device inference.

[0131] Based on the above layered architecture, this system includes a request listening module, a parameter validation module, a task scheduling module, an execution engine module, a model training module, a storage management module, and a model deployment module, which are described in detail below.

[0132] The request listening module is used for: receiving model training requests initiated by the client from the backend service (Web API service); The parameter verification module is used to: verify the legality of the request and the integrity of the parameters; The task scheduling module is used to: when the verification result is that the request is valid, concatenate the user's unique identifier and the project's unique identifier into a unique fingerprint for this task, and query the distributed cache to see if the lock mark corresponding to the unique fingerprint exists; if the lock mark exists, it is determined that there is an active task and a conflict response is returned to the client; otherwise, it is determined that there is no active task, the lock mark is written into the distributed cache, and the task log is initialized. The execution engine module is used to: distribute the current task context to independent child processes or worker threads; The model training module is used to: identify sensor data types and route different types of sensor data to corresponding model training strategies according to a preset sensor type-model training strategy mapping table. The storage management module is used to: after the model training is completed, output the model file and evaluation report to the database of the storage backend, update the task status in the distributed cache, release the lock flag, and destroy the child process or worker thread; The model deployment module is used for: the backend service (Web API service) to receive the model deployment request initiated by the client; after the client establishes a connection with the deployment device, the client sends the model file and deployment metadata to the deployment device to complete the embedded deployment.

[0133] In specific implementation, such as Figures 5-23 As shown, this system includes a model selection interface, a data acquisition interface, a model training interface, and a model deployment interface, which are described in detail below.

[0134] (a) Model selection interface: such as Figures 5-7 As shown, it is used to provide model type selection and project list management functions, including the type selection area and the My Models area, which are described in detail below.

[0135] 1.1 Select the type of region: such as Figure 5 As shown, preset templates for image models, speech models, and ToF models are provided, allowing users to select the desired model type from these preset templates and create training projects for the corresponding model type.

[0136] 1.2 My model region: such as Figure 6 , Figure 7 As shown, a list of training projects created by the user is provided. Each training project displays the project name, type icon, creation time, and has edit, rename, and delete buttons, supporting operations such as editing, renaming, and deleting training projects.

[0137] As can be seen from the above technical solution, users can create new training projects or select existing training projects through the model selection interface. The background service will assemble the basic information of the training project, including the following operation process: (1) Enter the "Select Model" interface, such as Figure 5 As shown. (2) In the "Select Model" area, select the model type required for training from image model, speech model, and ToF model. A new training project dialog box will pop up. Enter the project name in the naming field and click the OK button, as shown. Figure 6 As shown, create a new training project. (3) In the "My Model" area, select the training project you need from the list of training projects you have created. (4) Click the training project card to enter the corresponding data acquisition interface.

[0138] (ii) Data collection interface: such as Figures 8-14 As shown, it is used to provide data acquisition and sample management functions, including a connection mode selection window, an image data acquisition interface, a time series data acquisition interface, and a spectrum / cepstrum data acquisition interface, which are described in detail below.

[0139] 2.1 Connection Method Selection Window: (e.g.) Figure 8 As shown, it includes a USB mode button and a Bluetooth mode button, used to select a sensor from distance / displacement sensors (such as ToF sensors), acoustic sensors (such as audio sensors), and image sensors (such as cameras) to connect to the selected training project via USB or Bluetooth. Additionally, illumination sensors (such as light sensors) can be reserved as a potential expansion type.

[0140] 2.2 Image data acquisition interface: as shown Figures 8-10 As shown, when the connected sensor is an image-based sensor (such as a camera), it supports the acquisition and management of image data, including multiple sample areas. Each sample area includes a category label area, an add image sample button, a category sample display component, and an image sample display area, as described below.

[0141] 2.2.1 Category Label Area: Used to create and edit category labels (such as "horn" and "STOP") for collected data.

[0142] 2.2.2 Add Image Sample Button: Used for batch uploading image samples, and uses a camera icon to indicate that it can be directly captured by taking a picture.

[0143] 2.2.3 Image Sample Display Area: Used to display acquired image samples in a grid layout, and supports image thumbnail previews for easy sample quality checking, such as... Figure 10 As shown.

[0144] In practice, after the user selects an image model, the image data acquisition operation is as follows: (1) Create an independent sample area for each data category in the "Acquire Data" interface and edit the category label. (2) In each sample area, click the "Add Image Sample" button to upload local image samples or directly take a picture to collect samples. (3) Preview the collected image samples in the grid layout to ensure that each data category has a sufficient number of samples and build a training dataset.

[0145] 2.3 Time-series data acquisition interface: as shown Figures 12-14 As shown, when the connected sensor is a distance / displacement type (such as a ToF sensor), it supports the acquisition and management of time-series data, including multiple sample areas. Each sample area includes a category management component, a data visualization component, and an operation button component, which are described in detail below.

[0146] 2.3.1 Category Management Components: such as Figure 7 As shown, it includes category management options, category label area, sample quantity display area, and category icon area.

[0147] The category management menu supports operations such as uploading data, deleting a category, disabling a category, removing all samples, and downloading all samples. Uploading data allows importing sample data from other sources and supports uploading multiple files. Deleting or disabling a category allows users to delete or disable categories; disabled categories will not participate in training and can be re-enabled. Removing all samples clears all category data at once. Downloading all samples downloads all sample data from a category to the local machine. Furthermore, each sample supports individual deletion and movement operations; movement can be from one category to another.

[0148] Category Label Area: Used to create and edit category labels for collected data. For example, the default category labels are "class1" and "class2", but can also be customized by the user.

[0149] Sample Count Display Area: Used to count the number of samples collected. A maximum of 10 categories are allowed per item, and a maximum of 50 samples are allowed per category. For example, it may display "Total 2 data samples" or "Total 7 data samples".

[0150] Category icon area: Used to display the category of the collected data through icons. For example, a camera icon represents the image category, a microphone icon represents the audio category, and a sensor icon represents the ToF category.

[0151] 2.3.2 Data visualization components: such as Figure 7 , Figure 8 As shown, this is used to visualize the collected data and supports data zooming and viewing. Furthermore, both audio and ToF data are ultimately converted into one-dimensional arrays for visualization, with the difference being: audio data is visualized using period / energy, while ToF data is visualized using distance jumps / trends.

[0152] 2.3.3 Operation button component: such as Figure 7 , Figure 8 As shown, this includes a data acquisition button and a settings button. The data acquisition button is used to start data acquisition. The settings button is used to configure sampling parameters; for example, setting a delay time indicates how long after acquisition will begin; setting a duration indicates the duration of data acquisition.

[0153] 2.4 Spectrum / Cepstral Data Acquisition Interface: (e.g.) Figure 15 As shown, when the connected sensor is an acoustic type (such as an audio sensor), it supports the acquisition and management of spectrum / cepstrum data, including multiple sample areas. Each sample area includes a category management component, a data visualization component, and an operation button component, which is the same as the content of the time series data acquisition interface in 2.3.

[0154] It should be noted that each model allows the addition of multiple data categories, and users can add, delete, or modify categories and sample data for each category. Data acquisition via Bluetooth and USB is supported, as well as uploading local data. Different models employ different data processing methods during training. For example, images are first standardized to the same size and then normalized; audio data is first standardized using methods such as MFCC and then normalized; and data from sensors such as TOF are first constrained to maximum and minimum values ​​to ensure the raw data remains within a reasonable range before normalization.

[0155] (III) Training Model Interface: such as Figures 19-22 As shown, the interface for model training and evaluation includes image data training interface, time series data training interface, and spectral / ceptametric data training interface, which are described in detail below.

[0156] 3.1 Image data training interface: as shown Figure 15 As shown, when the sensor connected to the system is an image sensor (such as a camera), it is used to train an image model, including a model training component, a model reporting component, and a log output component.

[0157] 3.1.1 Model Training Components: These provide visualization of the network structure and configuration of training parameters, including options for selecting the neural network size, a visualization area for the network structure, configuration of training parameters, data augmentation options, and a start training button.

[0158] The options include: Select Neural Network Size: Choose the size of the training neural network, including small, medium, and large. Network Structure Visualization Area: Displays the input layer, hidden layers, and output layer. Training Parameter Configuration Component: Configure training parameters, including training period, learning rate, and minimum confidence score. Data Augmentation Options: Enable or disable data augmentation by checking checkboxes. Data augmentation is used to perform horizontal flipping, scaling, brightness, and contrast adjustments on the original samples to increase sample richness. Start Training Button: Start model training.

[0159] 3.1.2 Model Reporting Unit: Used for real-time monitoring of training progress and performance metrics, including the previous training performance area, confusion matrix area, and performance area on Nous.

[0160] The section on previous training results displays the results, including accuracy and missing values. The confusion matrix section displays the confusion matrix, with rows representing true labels and columns representing predicted labels. Color intensity indicates prediction accuracy. The F1 Score is a commonly used comprehensive metric for classification tasks, defined as the harmonic mean of precision and recall. The performance on Nous section includes inference time, peak memory usage, and flash memory usage.

[0161] 3.1.3 Log Output Component: Used to output logs, such as... Figure 18 As shown.

[0162] 3.2 Time Series Data Training Interface: When the connected sensor is a distance / displacement type (such as a ToF sensor), it is used to train and deploy the ToF model, including the model training component, the model reporting component, and the log output component.

[0163] Unlike the image data training interface, the model training component includes, in addition to options for selecting the neural network size, a network structure visualization area, a training parameter configuration component, and a start training button, a window size parameter component. Furthermore, as... Figure 16 As shown, the window size parameter component includes window frame size parameter, window increment interval parameter, and data padding zero option.

[0164] 3.3 Spectrum / Cepstral Data Training Interface: When the connected sensor is acoustic (e.g., an audio sensor), it is used to train and deploy speech models, including model training components, model reporting components, and log output components. Additionally, when the connected sensor is optical (e.g., a light sensor), the spectrum / cepstral data training interface can be reused, or enabled as a reserved extension type according to the deployment configuration.

[0165] Unlike the image data training interface, the model training component includes, in addition to options for selecting the neural network size, a network structure visualization area, a training parameter configuration component, and a start training button, a window size parameter component. Furthermore, as... Figure 17 As shown, the window size parameter component includes the window frame size parameter and the window increment interval parameter.

[0166] In specific implementation, the operation steps of this module are as follows: (1) The user views the network structure visualization diagram on the model training interface (displaying the input layer → hidden layer → output layer). (2) Configure training parameters: training period (40), learning rate (0.001), confidence threshold (0.6). The parameters opened by different models are slightly different. The commonly opened parameters are training period, learning rate and minimum confidence. The parameters opened by the image model have added data augmentation options. After checking, the sample data will be rotated, flipped and brightness adjusted automatically, which is convenient to improve the accuracy when the sample size is insufficient. The TOF model has additional parameters such as window size and interval time, as well as the option of zero padding, which is convenient to meet different scenario requirements. The speech model also supports parameters such as window size and interval time settings. (3) Click the "Start Training" button to start model training; the front end will send a request to the back end to start training, and at the same time send the corresponding model-related parameters; after receiving the parameters, the back end program assembles the training logic according to the parameters, the front end keeps polling the training progress, and prints the training progress and information in the log output unit. (4) After training is completed, the front end sends a request to obtain the training results. The training results will be displayed in detail through the model report unit, including information such as accuracy, missing values, and confusion matrix. Analyze the detailed confusion matrix and F1 score, and check the performance indicators: inference time, model size, and memory usage.

[0167] (iv) Model deployment interface: such as Figures 19-23 As shown, the window for deploying a pre-trained model includes a "Deploy Model" button, a "Select Model Area" window, and a "Select Connection Device" window, which are described below.

[0168] 4.1 Deploy Model Button: (e.g.) Figure 18 , Figure 19 As shown, after clicking "Deploy Model", the system automatically redirects to the My AI interface, where you can select "Load Model".

[0169] 4.2 Select the model region: such as Figure 21 As shown, this is used to create or select a specific model, including "My Models," "Preset AI Models," and a "Create Model" button. "My Models" refers to the previously trained model. "Preset AI Models" are models pre-trained by the official team and built into the My AI system. After selecting a model from "My Models" or "Preset AI Models," click the "Create Model" button to begin loading the model.

[0170] 4.3, Selecting the device connection method window: (e.g.) Figure 22 As shown, if the current deployment host is not connected to the deployment device, a connection interface will pop up, allowing you to connect to the deployment device via Bluetooth or USB.

[0171] In practice, the system automatically redirects to the My AI interface, where users can select the specific model to load. Then, the Web API service / client connects to the deployment device via Bluetooth or USB. Next, the client downloads the model-related files and information to the deployment device via Bluetooth or USB, such as... Figure 23 As shown.

[0172] As can be seen from the above embodiments, this system adopts an integrated data acquisition-training-deployment architecture, supports a unified data acquisition technology architecture with Bluetooth / USB device connections, and achieves seamless integration of the entire process through a complete AI development workflow integrated into a web interface, as well as technical assurance mechanisms for system scalability and maintainability. The end-to-end integrated process provides an efficient, reliable, and easy-to-use solution for AI development of smart hardware through a fully visualized, zero-code approach from data acquisition to model deployment, combined with a real-time training monitoring and performance evaluation system, and an integrated operation process based on a web interface.

[0173] The technical solutions provided by the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, based on the ideas of the present invention, modifications can be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. However, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the ideas and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method and system for training and embedding multi-sensor AI models, characterized in that, Includes the following steps: The backend service receives model training requests initiated by the client and verifies the legality of the request and the completeness of the parameters; When the verification result indicates that the request is valid, the user's unique identifier and the project's unique identifier are concatenated to form a unique fingerprint for this task, and the lock flag corresponding to the unique fingerprint is checked in the distributed cache. If the lock flag exists, it is determined that there is an active task and a conflict response is returned to the client. Otherwise, if there are no active tasks, the lock flag is written to the distributed cache, and the task log is initialized. The task context is distributed to independent subprocesses or worker threads, the sensor data types are identified, and different types of sensor data are routed to the corresponding model training strategies according to the preset sensor type-model training strategy mapping table. After the model training is completed, the model file and evaluation report are output to the storage backend, the task status in the distributed cache is updated, the lock is released, and the child process or worker thread is destroyed. The backend service receives the model deployment request initiated by the client and returns the model file and deployment metadata to the client; After the client establishes a connection with the deployment device, it sends the model file and deployment metadata to the deployment device to complete the embedded deployment.

2. The multi-sensor AI model training and embedded deployment method and system according to claim 1, characterized in that, The verification of the validity and parameter integrity of the request includes the following steps: Verify whether the request message contains required fields; the required fields include user unique identifier, project unique identifier, training label set, and sensor type. If any required field is missing, the request is deemed invalid and an error response is returned to the client. Otherwise, the request is considered valid.

3. A multi-sensor AI model training and embedded deployment method and system according to claim 1 or 2, characterized in that, The process of identifying sensor data types involves routing different types of sensor data to corresponding model training strategies based on a preset sensor type-model training strategy mapping table, including the following steps: The sensor type is identified by the sensor_type identifier, and the value of sensor_type is read from the context of this task. When sensor_type=1 or 4, it indicates that the sensor type is distance / displacement type, and distance / displacement type sensor data executes the time series model training sub-process; when sensor_type=3, it indicates that the sensor type is illumination type, and illumination type sensor data executes the spectrum / cepstrum model training sub-process. When sensor_type=2, it indicates that the sensor type is acoustic. Acoustic sensor data will be used to perform the spectrum / ceptomography model training subprocess. When sensor_type=5, it indicates that the sensor type is image type, and image type sensor data will be used to perform the image model training subprocess.

4. The multi-sensor AI model training and embedded deployment method and system according to claim 3, characterized in that, The image sensor data is used to perform an image model training sub-process, which includes the following steps: The target category image index is obtained from the storage backend, the image stream is traversed and downloaded, and decoding and normalization preprocessing are performed to obtain valid samples; Verify the number of valid samples; if the number is 0, trigger exception handling and terminate the process. If the quantity is 1, then the valid samples are copied to continue training, and the valid samples are divided into training set and test set; If the number is greater than or equal to 2, then the effective samples are directly divided into training set and test set; Load a pre-built lightweight convolutional neural network as the backbone of the model and freeze the feature extraction layer; A global average pooling layer, a Dropout layer, and a fully connected classification layer are added sequentially to the output of the backbone network. The fully connected classification layer is trained by backpropagation using the training set, and the current performance metrics are written to the distributed cache in real time through a callback function so that the training progress and performance metrics can be displayed on the front-end interface, thus obtaining a floating-point model. Representative samples are randomly selected from the training set to statistically analyze the distribution range of activation values ​​in each layer of the model and construct quantization calibration data. The floating-point model is then subjected to full integer quantization using the quantization calibration data to generate an edge-side quantized model file in lightweight inference model format. The quantization model is tested using a test set, its performance metrics are calculated, and a confusion matrix visualization is generated.

5. The multi-sensor AI model training and embedded deployment method and system according to claim 4, characterized in that, The process of dividing the effective samples into a training set and a test set includes the following steps: Let the total number of samples be N and the number of categories be C. First, calculate the test set size test_size = max(1, int(0.2 × N)). Then, determine whether the stratification condition C > 1 and the number of samples in each category is ≥ 2. If it is satisfied, then the test set size test_size = max(test_size, C), and stratified sampling is used to divide the valid samples into the training set and the test set according to the preset ratio. Otherwise, non-stratified sampling is used to divide the valid samples into the training set and the test set. When using stratified sampling, if the test set size test_size ≥ N, then adjust the test set size test_size = N-1 and the training set size train_size = N-test_size; if stratified sampling fails, then use non-stratified sampling, and the test set size is test_size = min(N-1, max(1, C)). After completing stratified sampling, if the test set is found to be empty, a sample is taken from the training set and moved to the test set.

6. The multi-sensor AI model training and embedded deployment method and system according to claim 3, characterized in that, The acoustic sensor data is used to perform a spectrum / ceptomography model training sub-process, which includes the following steps: The system retrieves the original audio waveform data of the target category from the storage backend; performs time-domain pre-emphasis and fixed-frame-length segmentation on the waveform data to obtain frame-by-frame data; performs windowing and fast Fourier transform on the frame-by-frame data to obtain the frequency domain energy spectrum; maps the frequency domain energy spectrum to the Mel scale and extracts the Mel frequency cepstral coefficients. Cepstral mean-variance normalization is performed on the MFCC frame sequence of each sliding window segment to obtain standardized MFCC feature data; The standardized MFCC feature matrix is ​​flattened into a one-dimensional feature vector and used as sample data, which is then divided into training set, validation set and test set according to a preset ratio. For the two-dimensional feature map obtained by reshaping the one-dimensional feature vector within the model, a convolutional neural network containing convolutional layers and max pooling layers is constructed; the convolutional neural network model is iteratively trained using training set data, the model parameters are optimized through backpropagation, and the convergence trend of the loss function is monitored in real time to obtain a floating-point model; Perform full integer quantization on the floating-point model to generate an edge inference file in a lightweight inference model format.

7. The multi-sensor AI model training and embedded deployment method and system according to claim 3, characterized in that, The time-series model training sub-process for distance / displacement sensor data includes the following steps: The system retrieves raw sample data of the target category from the storage backend and forms a one-dimensional time-series data stream; it sets the time-domain sliding window length and sliding step size according to the configuration parameters, and calculates the number of sampling points contained in each window based on the sensor sampling rate; Starting from the beginning of the time-series data stream, the first data segment is extracted according to the window length. Then, the window is moved on the time axis according to the sliding step size, and each time a data segment of the window length is extracted as an independent training sample. If zero padding is enabled, the extraction stops when the remaining length is insufficient and exceeds the threshold. If zero padding is disabled, the subsequent data segments are discarded directly when the remaining length is reached. Verify whether the sample length reaches the expected number of sampling points; if zero padding is enabled: when the sample length is insufficient but meets the padding threshold, zero padding is performed at the end of the insufficient data segment until the standard input dimension is reached; when the sample length is insufficient and exceeds the padding threshold, the insufficient data segment is discarded directly; if zero padding is disabled: the insufficient data segment is discarded directly. The fixed-length data segments that have undergone verification and completion are converted into one-dimensional feature vectors and added to the sample set; The number of samples in each category in the statistical sample set is counted, the proportion of each category is calculated, and the sample set is divided into training set, validation set and test set according to the proportion of each category. For one-dimensional time-series data streams, a multilayer perceptron fully connected network consisting of an input layer, at least one hidden layer, and an output layer is constructed. The MLP model is iteratively trained using a hierarchical training set, and the neuron weights are optimized in real time through backpropagation. The convergence of the loss function is verified simultaneously to obtain a floating-point model. Perform full integer quantization on the floating-point model to generate an edge inference file in a lightweight inference model format.

8. A multi-sensor AI training and embedded deployment system, used to execute the multi-sensor AI training and embedded deployment method as described in any one of claims 1 to 7, characterized in that, It includes a request listening module, a parameter validation module, a task scheduling module, an execution engine module, a model training module, a storage management module, and a model deployment module; The request listening module is used for: receiving model training requests initiated by the client by the backend service; The parameter verification module is used to: verify the legality of the request and the integrity of the parameters; The task scheduling module is used to: when the verification result is that the request is valid, concatenate the user's unique identifier and the project's unique identifier into a unique fingerprint for this task, and query the distributed cache to see if the lock mark corresponding to the unique fingerprint exists; if the lock mark exists, it is determined that there is an active task and a conflict response is returned to the client. Otherwise, if there are no active tasks, the lock flag is written to the distributed cache, and the task log is initialized. The execution engine module is used to: distribute the current task context to independent child processes or worker threads; The model training module is used to: identify sensor data types and route different types of sensor data to corresponding model training strategies according to a preset sensor type-model training strategy mapping table. The storage management module is used to: after the model training is completed, output the model file and evaluation report to the storage backend, update the task status in the distributed cache, release the lock flag, and destroy the child process or worker thread; The model deployment module is used for: receiving a model deployment request initiated by the client and returning the model file and deployment metadata to the client; After the client establishes a connection with the deployment device, it sends the model file and deployment metadata to the deployment device to complete the embedded deployment.