Motion direction prediction method and device, equipment, storage medium and program product

By converting the motion direction into a sine function and encoding it into a binary matrix, and inputting the motion direction prediction model, the problem of inefficient calculation in high-dimensional sparse data processing is solved, and more efficient direction prediction is achieved.

CN119887838APending Publication Date: 2025-04-25AEROSPACE INFORMATION RES INST CAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411821611.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When traditional vector addition operations process high-dimensional and sparse data, the computational complexity increases sharply, resulting in low computational efficiency and seriously affecting performance.

Method used

By converting the direction of motion into a sine function and sampling the sine function, floating point values ​​are obtained, and the floating point values ​​are converted into binary encoding format through a scalar encoder to obtain a vector encoding matrix, and input the motion direction prediction model to predict the motion direction of the next moment.

Benefits of technology

The accuracy and efficiency of direction vector data processing are improved, the characteristics of direction vector can be better captured, and the generalization ability and learning efficiency of the model are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887838A_ABST
    Figure CN119887838A_ABST
Patent Text Reader

Abstract

The invention provides a motion direction prediction method and device, equipment, a storage medium and a program product, and is applied to the technical field of data processing. The method comprises the following steps: acquiring the motion direction of a moving target at the current moment, wherein the motion direction comprises the modulus length of a direction vector and the angle of the direction vector; converting the motion direction into a sine function, sampling the sine function to obtain a floating point value, and converting the floating point value into a binary coding format through a scalar encoder to obtain a vector coding matrix; and inputting the vector coding matrix into a motion direction prediction model to obtain the motion direction of the motion target at the next moment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a motion direction prediction method, device, equipment, storage medium and program product. Background Art

[0002] In the existing field of artificial intelligence and computer vision technology, vector operations occupy a very critical position in basic mathematical operations, and their application range covers many important fields such as image processing, signal processing, and robot positioning. For example, in the robot positioning scenario, vector operations can be used to determine the robot's position coordinates in space, the direction of movement, and the relative position relationship between the robot and the target object.

[0003] Traditional vector addition operations mainly rely on geometric calculation methods. Specifically, they rely on the rectangular coordinate representation or polar coordinate representation of the vector to achieve simple vector addition operations. However, when faced with high-dimensional and sparse data, these traditional methods expose many drawbacks. High-dimensional data means that the vector has a large number of components, while sparse data means that most of the elements in the vector are zero. In this case, the computational complexity of traditional geometric calculation methods will increase sharply because they need to process the coordinates of each dimension one by one. For example, when processing a sparse vector addition with thousands of dimensions, traditional methods may need to traverse the entire vector. Even if most of the elements are zero, a large number of meaningless calculation operations still need to be performed, which leads to low computational efficiency and seriously affects the performance of related technologies when processing large-scale high-dimensional sparse data. Summary of the invention

[0004] The present invention provides a motion direction prediction method, device, equipment, storage medium and program product, which are used to solve the problem of low computational efficiency of traditional vector operation mode when processing large-scale high-dimensional sparse data.

[0005] The present invention provides a motion direction prediction method, comprising: obtaining the motion direction of a moving target at a current moment, the motion direction comprising the modulus length of a direction vector and the angle of the direction vector; converting the motion direction into a sine function, sampling the sine function to obtain a floating point value, converting the floating point value into a binary coding format through a scalar encoder to obtain a vector coding matrix; inputting the vector coding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0006] According to a motion direction prediction method provided by the present invention, the step of converting the motion direction into a sine function comprises: according to the formula The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

[0007] According to a motion direction prediction method provided by the present invention, before inputting the vector coding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment, the method further includes: training the motion direction prediction model based on a back propagation algorithm with momentum.

[0008] According to a motion direction prediction method provided by the present invention, the motion direction prediction model includes an input layer, a hidden layer and an output layer; the hidden layer is configured as a multi-layer perceptron.

[0009] According to a motion direction prediction method provided by the present invention, the motion direction prediction model is a hierarchical temporal memory HTM model.

[0010] The present invention also provides a motion direction prediction device, comprising the following modules: an acquisition module and a processing module; the acquisition module is used to acquire the motion direction of the moving target at the current moment, and the motion direction includes the module length of the direction vector and the angle of the direction vector; the processing module is used to convert the motion direction into a sine function, and sample the sine function to obtain a floating point value, and convert the floating point value into a binary coding format through a scalar encoder to obtain a vector coding matrix; the vector coding matrix is ​​input into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0011] According to a motion direction prediction device provided by the present invention, the processing module is used to predict the motion direction according to the formula The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

[0012] According to a motion direction prediction device provided by the present invention, the processing module is further used to train the motion direction prediction model based on a back propagation algorithm with momentum.

[0013] According to a motion direction prediction device provided by the present invention, the motion direction prediction model includes an input layer, a hidden layer and an output layer; the hidden layer is configured as a multi-layer perceptron.

[0014] According to a motion direction prediction device provided by the present invention, the motion direction prediction model is a hierarchical temporal memory HTM model.

[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the motion direction prediction methods described above is implemented.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the motion direction prediction method as described above is implemented.

[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned motion direction prediction methods.

[0018] The motion direction prediction method, device, equipment, storage medium and program product provided by the present invention can convert the motion direction into a sine function, sample the sine function to obtain a floating point value, and convert the floating point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix. Since the direction vector can be converted into data suitable for processing by the motion direction prediction model, it can not only improve the accuracy and efficiency of the direction vector data processing, but also better capture the characteristics of the direction vector, and enhance the generalization ability and learning efficiency of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 It is a schematic flow chart of the motion direction prediction method provided by the present invention; Figure 2 It is a structural schematic diagram of a motion direction prediction device provided by the present invention; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0023] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0024] In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution.

[0025] The embodiments of the present application describe some exemplary embodiments for the purpose of explanation. It should be understood that the present application can be implemented in other ways that are not specifically shown in the drawings.

[0026] like Figure 1 As shown, the embodiment of the present application provides a motion direction prediction method, which can be applied to a motion direction prediction device. The motion direction prediction method may include S101-S103: S101. A motion direction prediction device obtains a motion direction of a moving target at a current moment.

[0027] The above-mentioned movement direction includes the modulus of the direction vector and the angle of the direction vector.

[0028] It should be noted that the modulus of the direction vector represents the magnitude of the vector, and the angle of the direction vector represents the direction of the vector.

[0029] S102, the motion direction prediction device converts the motion direction into a sine function, samples the sine function to obtain a floating point value, and converts the floating point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix.

[0030] Optionally, converting the motion direction into a sine function comprises: according to the formula The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

[0031] Specifically, the motion direction prediction device can convert the modulus and angle of the direction vector into a curve representation through a sine function, that is, through the formula The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Represents the phase offset, which ensures that the center of the sinusoid is aligned with the direction vector.

[0032] Afterwards, the motion direction prediction device can sample the converted sine function to generate the corresponding floating point value. Then, a scalar encoder is used to convert the floating point value into a binary encoding format, that is, a combination of 0 and 1, to form a vector encoding matrix suitable for the motion direction prediction model input. The vector encoding matrix is ​​the encoded direction vector data represented in the form of a matrix or array, which can be directly input into the motion direction prediction model.

[0033] It should be noted that the scalar encoder can accurately discretize the continuous values ​​of the direction vector into binary representation and maintain the relative relationship between the values. This encoding method not only retains the direction and modulus information of the vector, but also improves the trainability of the data in the neural network.

[0034] Optionally, before using a scalar encoder to convert the floating-point value into a binary encoding format, the motion direction prediction device may filter the floating-point value based on a preset range, and the preset range may be (0, 10).

[0035] S103 , the motion direction prediction device inputs the vector coding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0036] Optionally, the motion direction prediction model includes an input layer, a hidden layer and an output layer; the hidden layer is configured as a multi-layer perceptron.

[0037] Specifically, the number of neurons in the input layer is consistent with the dimension of the vector encoding matrix, the number of neurons in the output layer can be determined according to specific application requirements, and the configuration of the hidden layer can be flexibly adjusted according to specific application requirements. The typical configuration can be a multi-layer perceptron (MLP), such as {720, 360, 90, 20, 2}, where each number represents the number of neurons in the layer. In this way, the complex patterns and features in the direction vector can be fully captured.

[0038] Optionally, before inputting the vector coding matrix into the motion direction prediction model to obtain the motion direction of the moving target at the next moment, the motion direction prediction device may train the motion direction prediction model based on a back propagation algorithm with momentum.

[0039] Specifically, the basic principle of backpropagation is based on the chain rule. By calculating the derivative of the loss function (which measures the difference between the network output and the true label) to each weight in the motion direction prediction model, it is determined how to adjust the weight to reduce the loss. In simple terms, starting from the output layer of the motion direction prediction model, the influence of the error on the weights of each layer is calculated layer by layer in reverse, and then the weights are updated according to these influences, so that the output of the motion direction prediction model is closer to the true value. In the standard backpropagation algorithm, each time the weight is updated, the weight is simply adjusted according to the currently calculated gradient (that is, the derivative of the loss function to the weight). However, the backpropagation algorithm with momentum adds a momentum term on this basis. Momentum can be regarded as an accumulation of past gradient information. It makes the weight update not only depend on the current gradient, but also be affected by the previous gradient change trend. Specifically, just like an object has inertia during movement, when the weight is updated, the previous "motion direction" (that is, the change of the previous gradient) will be referred to. The advantage of doing this is that during the training process, if a local minimum or an area with a relatively flat gradient is encountered, momentum can help the weight update continue to maintain a certain "impulse" to avoid falling into a local minimum or updating too slowly in a flat area, thereby speeding up the training speed and possibly finding a better weight configuration, so that the motion direction prediction model can better learn the patterns in the data.

[0040] It should be noted that appropriate learning rates and error thresholds can be set to optimize the training process of the motion direction prediction model and ensure that the motion direction prediction model can effectively learn the relationship between direction vectors. For example, the learning rate can be set to 1.0, which is used to control the update amplitude of the weights at each iteration. The maximum error is set to 0.0001, indicating that the training process will continue until the network error is lower than the maximum error value.

[0041] Optionally, the error calculation formula of the motion direction prediction model is: ; in, represents the total error, represents the number of samples, represents the target output, Represents the prediction output of the motion direction prediction model.

[0042] Optionally, the motion direction prediction model is a Hierarchical Temporal Memory (HTM) model. The HTM model is a computational model that simulates the cerebral cortex and has the advantages of processing time series data, sparse data, and spatial data. The HTM model can effectively capture the temporal dependencies and spatial patterns in the data by establishing memory units and time series associations, and is particularly suitable for complex time series prediction, anomaly detection and other tasks. Since the application of the HTM model in vector arithmetic operations is still in its infancy, the expression ability and accuracy of the direction vector data can be improved by converting the direction vector into a vector encoding matrix, making it more suitable for the processing and learning of the HTM model.

[0043] In the embodiment of the present application, the motion direction can be converted into a sine function, and the sine function is sampled to obtain a floating point value, and the floating point value is converted into a binary encoding format through a scalar encoder to obtain a vector encoding matrix. Since the direction vector can be converted into data suitable for processing by the motion direction prediction model, it can not only improve the accuracy and efficiency of the direction vector data processing, but also better capture the characteristics of the direction vector, and enhance the generalization ability and learning efficiency of the model.

[0044] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0045] The motion direction prediction method provided in the embodiment of the present application can be executed by a motion direction prediction device or a control module for motion direction prediction in the motion direction prediction device. In the embodiment of the present application, the motion direction prediction device provided in the embodiment of the present application is described by taking the motion direction prediction method executed by the motion direction prediction device as an example.

[0046] It should be noted that the embodiment of the present application can divide the motion direction prediction device into functional modules according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0047] like Figure 2 As shown, an embodiment of the present application provides a motion direction prediction device 200. The motion direction prediction device 200 includes: an acquisition module 201 and a processing module 202. The acquisition module 201 can be used to obtain the motion direction of the moving target at the current moment, and the motion direction includes the modulus length of the direction vector and the angle of the direction vector; the processing module 202 is used to convert the motion direction into a sine function, and sample the sine function to obtain a floating point value, and convert the floating point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix; the vector encoding matrix is ​​input into the motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0048] Optionally, the processing module 202 is used to calculate the The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

[0049] Optionally, the processing module 202 is further configured to train the motion direction prediction model based on a back propagation algorithm with momentum.

[0050] Optionally, the motion direction prediction model includes an input layer, a hidden layer and an output layer; the hidden layer is configured as a multi-layer perceptron.

[0051] Optionally, the motion direction prediction model is a hierarchical temporal memory HTM model.

[0052] In the embodiment of the present application, the motion direction can be converted into a sine function, and the sine function is sampled to obtain a floating point value, and the floating point value is converted into a binary encoding format through a scalar encoder to obtain a vector encoding matrix. Since the direction vector can be converted into data suitable for processing by the motion direction prediction model, it can not only improve the accuracy and efficiency of the direction vector data processing, but also better capture the characteristics of the direction vector, and enhance the generalization ability and learning efficiency of the model.

[0053] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the motion direction prediction method, which includes: obtaining the motion direction of the moving target at the current moment, the motion direction including the modulus length of the direction vector and the angle of the direction vector; converting the motion direction into a sine function, sampling the sine function to obtain a floating point value, converting the floating point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix; inputting the vector encoding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0054] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0055] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the motion direction prediction method provided by the above-mentioned methods, which method includes: obtaining the motion direction of the moving target at a current moment, and the motion direction includes the modulus of the direction vector and the angle of the direction vector; converting the motion direction into a sine function, and sampling the sine function to obtain a floating-point value, and converting the floating-point value into a binary coding format through a scalar encoder to obtain a vector coding matrix; inputting the vector coding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0056] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the motion direction prediction method provided by the above-mentioned methods, the method comprising: obtaining the motion direction of the moving target at a current moment, the motion direction comprising the modulus of the direction vector and the angle of the direction vector; converting the motion direction into a sine function, sampling the sine function to obtain a floating-point value, converting the floating-point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix; inputting the vector encoding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

[0057] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A motion direction prediction method, characterized in that: include: Obtaining the current moving direction of the moving target, wherein the moving direction includes the modulus length of the direction vector and the angle of the direction vector; Convert the motion direction into a sine function, sample the sine function to obtain a floating point value, and convert the floating point value into a binary encoding format through a scalar encoder to obtain a vector encoding matrix; The vector coding matrix is ​​input into a motion direction prediction model to obtain the motion direction of the moving target at the next moment.

2. The motion direction prediction method according to claim 1, characterized in that: The step of converting the motion direction into a sinusoidal function comprises: According to the formula converting the direction of motion into a sinusoidal function; in, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

3. The motion direction prediction method according to claim 1, characterized in that: Before inputting the vector coding matrix into a motion direction prediction model to obtain the motion direction of the moving target at the next moment, the method further includes: The motion direction prediction model is trained based on a back propagation algorithm with momentum.

4. The motion direction prediction method according to claim 1 or 3, characterized in that: The motion direction prediction model includes an input layer, a hidden layer and an output layer; the hidden layer is configured as a multi-layer perceptron.

5. The motion direction prediction method according to claim 1, characterized in that: The motion direction prediction model is a hierarchical temporal memory HTM model.

6. A motion direction prediction device, characterized in that: include: Acquisition module and processing module; The acquisition module is used to acquire the moving direction of the moving target at a current moment, wherein the moving direction includes the modulus length of the direction vector and the angle of the direction vector; The processing module is used to convert the movement direction into a sine function, sample the sine function to obtain a floating-point value, convert the floating-point value into a binary coding format through a scalar encoder to obtain a vector coding matrix; input the vector coding matrix into a movement direction prediction model to obtain the movement direction of the moving target at the next moment.

7. The motion direction prediction device according to claim 6, characterized in that: The processing module is used to The motion direction is converted into a sine function; wherein, represents the magnitude of the direction vector, represents the angle of the direction vector, Indicates the angle range during encoding, , Indicates the phase offset.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the motion direction prediction method according to any one of claims 1 to 5 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the motion direction prediction method according to any one of claims 1 to 5 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the motion direction prediction method according to any one of claims 1 to 5 is implemented.