[go: up one dir, main page]

CN116611481A - Object motion trend sensing method and system based on impulse neural network - Google Patents

Object motion trend sensing method and system based on impulse neural network Download PDF

Info

Publication number
CN116611481A
CN116611481A CN202310235879.7A CN202310235879A CN116611481A CN 116611481 A CN116611481 A CN 116611481A CN 202310235879 A CN202310235879 A CN 202310235879A CN 116611481 A CN116611481 A CN 116611481A
Authority
CN
China
Prior art keywords
information
neural network
pulse
index
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310235879.7A
Other languages
Chinese (zh)
Other versions
CN116611481B (en
Inventor
曹健
闫俊彤
王源
冯硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University filed Critical Peking University
Priority to CN202310235879.7A priority Critical patent/CN116611481B/en
Publication of CN116611481A publication Critical patent/CN116611481A/en
Application granted granted Critical
Publication of CN116611481B publication Critical patent/CN116611481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/092Reinforcement learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Neurology (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to an object motion trend sensing method and system based on a pulse neural network, comprising the steps of obtaining an index of a current area of an object; generating pulse information by binary coding the region index; the FPGA converts the pulse information into frame information and sends the frame information to the PAICORE2.0 through a PCIe interface; and the PAICORE2.0 analyzes the frame information and performs reasoning to generate the position information of the object at the next moment, wherein the PAICORE2.0 is a brain-like chip deployed with a pulse neural network model and is used for realizing the pulse neural network function. The method solves the problems of long calculation time, high power consumption of a hardware system and low utilization rate of time-space relevance of information in the traditional algorithm.

Description

一种基于脉冲神经网络的物体运动趋势感知方法和系统A method and system for object movement trend perception based on spiking neural network

技术领域technical field

本发明涉及新型计算机技术领域,尤其涉及一种基于脉冲神经网络的物体运动趋势感知方法和系统。The invention relates to the field of new computer technologies, in particular to a method and system for sensing object movement trends based on a pulse neural network.

背景技术Background technique

目前已有的物体运动趋势感知系统大多是以传统的目标检测算法和跟踪算法相结合实现的。传统的目标检测算法主要包括静态背景下的背景差分法、帧间差分法、光流法和动态背景下的基于块的运动估算和补偿法,主要任务是从序列图像中将变化区域从背景图像中提取出来。传统的跟踪算法首先对目标进行有效的表达,然后采用相似性度量算法匹配运动目标与帧图像,最后利用搜索算法匹配最佳位置,常见的预测算法有Kalman滤波、粒子滤波方法等。Most of the existing object motion trend perception systems are realized by combining the traditional target detection algorithm and tracking algorithm. Traditional target detection algorithms mainly include background difference method, inter-frame difference method, optical flow method and block-based motion estimation and compensation method in dynamic background. extracted from. The traditional tracking algorithm first expresses the target effectively, then uses the similarity measurement algorithm to match the moving target and the frame image, and finally uses the search algorithm to match the best position. Common prediction algorithms include Kalman filter and particle filter methods.

而已有技术存在以下缺点:1、传统目标检测与预测算法计算时间冗长。传统算法的硬件实现需要耗费几百毫秒时间,无法用于高速运动目标的趋势预测感知。2、硬件系统功耗大。传统算法部署不使用专用芯片,计算耗费资源多,功耗大。3、对信息时空关联性利用率低。传统物体运动趋势感知系统的实现借助于连续的单次计算,不考虑信息的时间关联性。However, the prior art has the following disadvantages: 1. The calculation time of traditional target detection and prediction algorithms is long. The hardware implementation of traditional algorithms takes hundreds of milliseconds and cannot be used for trend prediction and perception of high-speed moving targets. 2. The hardware system consumes a lot of power. Traditional algorithm deployment does not use dedicated chips, which consumes a lot of resources and consumes a lot of power. 3. The utilization rate of information spatio-temporal relevance is low. The realization of the traditional object motion trend perception system relies on continuous single calculation, without considering the temporal correlation of information.

发明内容Contents of the invention

为了解决上述背景技术中提到的至少一个问题,本发明提出一种基于脉冲神经网络的物体运动趋势感知方法及系统,由PC通过事件信息判断物体当前所在区域索引,经过二进制编码生成脉冲信息。FPGA作为脉冲信息和PAICORE2.0需要的帧的转化器,将帧通过PCIe接口(2.5GT/s)发送至PAICORE2.0。PAI CORE2.0解析帧信息,将脉冲信息送入内部搭建好的脉冲神经网络进行推理,获得下一时刻物体的位置信息。将此信息通过帧发送给FPGA再传给PC,解析得到对应的位置索引,就实现了物体运动趋势的感知。In order to solve at least one of the problems mentioned in the above-mentioned background technology, the present invention proposes a method and system for sensing the movement trend of an object based on a pulse neural network. The PC judges the current area index of the object through event information, and generates pulse information through binary coding. As a converter of pulse information and frames required by PAICORE2.0, FPGA sends frames to PAICORE2.0 through PCIe interface (2.5GT/s). PAI CORE2.0 analyzes the frame information, sends the pulse information to the internally built pulse neural network for inference, and obtains the position information of the object at the next moment. Send this information to the FPGA through the frame and then to the PC, analyze and obtain the corresponding position index, and realize the perception of the movement trend of the object.

为实现以上目的,本发明所采用的技术方案包括:For realizing the above object, the technical scheme adopted in the present invention comprises:

一种基于脉冲神经网络的物体运动趋势感知方法,包括:A spiking neural network-based object motion trend perception method, comprising:

获取物体当前所在区域索引;Get the index of the area where the object is currently located;

将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information;

FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface;

所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The PAICORE 2.0 analyzes the frame information and performs inference to generate the position information of the object at the next moment.

进一步地,所述PAICORE2.0是部署有脉冲神经网络模型的类脑芯片,用于实现脉冲神经网络功能。Further, the PAICORE2.0 is a brain-inspired chip deployed with a spiking neural network model, which is used to realize the function of the spiking neural network.

进一步地,所述获取物体当前所在区域索引,包括:由PC通过事件信息判断物体当前所在区域索引,其中,所述事件信息的获取方法包括采用传感器进行获取。Further, the acquiring the index of the area where the object is currently located includes: judging the index of the area where the object is currently located by the PC through event information, wherein the method for acquiring the event information includes acquiring by using a sensor.

进一步地,所述方法还包括:将所述位置信息通过所述FPGA传回至PC,解析得到与所述位置信息对应的位置索引。Further, the method further includes: sending the location information back to the PC through the FPGA, and analyzing to obtain a location index corresponding to the location information.

进一步地,所述方法还包括:利用DQN训练神经网络,将所述神经网络化转换为所述脉冲神经网络。Further, the method further includes: using DQN to train a neural network, and converting the neural network into the spiking neural network.

进一步地,所述PAICORE2.0支持LIF神经元模型。Further, the PAICORE2.0 supports the LIF neuron model.

本发明还涉及一种基于脉冲神经网络的物体运动趋势感知系统,包括:The present invention also relates to an object motion trend perception system based on a pulse neural network, comprising:

输入模块,用于获取物体当前所在区域索引;The input module is used to obtain the index of the area where the object is currently located;

将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information;

FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface;

处理模块,用于所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The processing module is used for the PAICORE2.0 to analyze the frame information and perform inference to generate the position information of the object at the next moment.

本发明还涉及一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述的方法。The present invention also relates to a computer-readable storage medium, on which a computer program is stored, and the above-mentioned method is realized when the computer program is executed by a processor.

本发明还涉及一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的方法。The present invention also relates to an electronic device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, and the processor implements the above-mentioned method when executing the computer program.

本发明还涉及一种计算机程序产品,包括计算机程序和/或指令,其特征在于,该计算机程序和/或指令被处理器执行时实现上述方法的步骤。The present invention also relates to a computer program product, including computer programs and/or instructions, characterized in that, when the computer programs and/or instructions are executed by a processor, the steps of the above method are realized.

本发明的有益效果为:The beneficial effects of the present invention are:

1、相比于传统算法几百毫秒的计算延迟,利用PAICORE2.0与事件信息处理的特性实现10ms/每次反馈的反应速度。1. Compared with the calculation delay of hundreds of milliseconds in the traditional algorithm, the response speed of 10ms/each feedback is realized by using the characteristics of PAICORE2.0 and event information processing.

2、硬件功耗低,物体运动趋势感知系统运行时,PAICORE2.0的功耗在1W以内。2. The hardware power consumption is low. When the object movement trend perception system is running, the power consumption of PAICORE2.0 is within 1W.

3、利用信息的事件相关性,类生物处理信息的方式,由事件流二进制编码为脉冲信息,脉冲神经网络利用脉冲的时间空间相关性进行推理,加快感知速度。3. Utilizing the event correlation of information, the way of bio-like processing information, the event stream is binary coded into pulse information, and the pulse neural network uses the temporal and spatial correlation of pulses to reason and speed up perception.

附图说明Description of drawings

图1为本发明基于脉冲神经网络的物体运动趋势感知方法流程示意图。FIG. 1 is a schematic flow chart of the object movement trend perception method based on the spiking neural network of the present invention.

图2为本发明优选实施例模拟场景示意图。Fig. 2 is a schematic diagram of a simulated scene in a preferred embodiment of the present invention.

图3为本发明优选实施例乒乓球拦截实验程序流程图。Fig. 3 is a flow chart of the table tennis interception experiment program of the preferred embodiment of the present invention.

图4为本发明优选实施例中滑块的拦截运动方式的约束示意图。Fig. 4 is a schematic diagram of constraints on the way of intercepting movement of the slider in the preferred embodiment of the present invention.

图5为本发明优选实施例神经网络结构图。Fig. 5 is a structural diagram of a neural network in a preferred embodiment of the present invention.

图6为本发明优选实施例DQN算法原理示意图。Fig. 6 is a schematic diagram of the principles of the DQN algorithm in the preferred embodiment of the present invention.

图7为本发明优选实施例神经网络训练流程图。Fig. 7 is a flowchart of neural network training in a preferred embodiment of the present invention.

图8为本发明优选实施例生物神经元至脉冲神经元的抽象过程示意图。Fig. 8 is a schematic diagram of an abstract process from a biological neuron to a spiking neuron in a preferred embodiment of the present invention.

图9为本发明优选实施例抽象后的脉冲神经元模型。Fig. 9 is an abstracted spiking neuron model of the preferred embodiment of the present invention.

图10为本发明优选实施例ANN与SNN的计算模式对比示意图。FIG. 10 is a schematic diagram of a comparison of calculation modes between ANN and SNN in a preferred embodiment of the present invention.

图11为本发明基于脉冲神经网络的物体运动趋势感知系统结构示意图。FIG. 11 is a schematic structural diagram of the object movement trend perception system based on the spiking neural network of the present invention.

图12为本发明优选实施例输入模块简化接线图。Fig. 12 is a simplified wiring diagram of the input module of the preferred embodiment of the present invention.

图13为本发明优选实施例输入模块程序流程图。Fig. 13 is a program flow chart of the input module of the preferred embodiment of the present invention.

图14为本发明优选实施例处理模块程序流程图。Fig. 14 is a flow chart of the processing module program in the preferred embodiment of the present invention.

图15为本发明优选实施例输出模块程序流程图。Fig. 15 is a flow chart of the output module program in the preferred embodiment of the present invention.

图16为本发明最终实测系统参数图。Fig. 16 is the final measured system parameter diagram of the present invention.

具体实施方式Detailed ways

为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本说明书的一些示例或实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图将本说明书应用于其它类似情景。除非从语言环境中显而易见或另做说明,图中相同标号代表相同结构或操作。In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the following briefly introduces the drawings that need to be used in the description of the embodiments. Apparently, the accompanying drawings in the following description are only some examples or embodiments of this specification, and those skilled in the art can also apply this specification to other similar scenarios. Unless otherwise apparent from context or otherwise indicated, like reference numerals in the figures represent like structures or operations.

应当理解,本文使用的“系统”、“装置”、“单元”和/或“模块”是用于区分不同级别的不同组件、元件、部件、部分或装配的一种方法。然而,如果其他词语可实现相同的目的,则可通过其他表达来替换所述词语。It should be understood that "system", "device", "unit" and/or "module" as used herein is a method for distinguishing different components, elements, parts, parts or assemblies of different levels. However, the words may be replaced by other expressions if other words can achieve the same purpose.

如本说明书和权利要求书中所示,除非上下文明确提示例外情形,“一”、“一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。一般说来,术语“包括”与“包含”仅提示包括已明确标识的步骤和元素,而这些步骤和元素不构成一个排它性的罗列,方法或者设备也可能包含其它的步骤或元素。As indicated in the specification and claims, the terms "a", "an", "an" and/or "the" are not specific to the singular and may include the plural unless the context clearly indicates an exception. Generally speaking, the terms "comprising" and "comprising" only suggest the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list, and the method or device may also contain other steps or elements.

本说明书中使用了流程图用来说明根据本说明书的实施例的系统所执行的操作。应当理解的是,前面或后面操作不一定按照顺序来精确地执行。相反,可以按照倒序或同时处理各个步骤。同时,也可以将其他操作添加到这些过程中,或从这些过程移除某一步或数步操作。The flowchart is used in this specification to illustrate the operations performed by the system according to the embodiment of this specification. It should be understood that the preceding or following operations are not necessarily performed in the exact order. Instead, various steps may be processed in reverse order or simultaneously. At the same time, other operations can be added to these procedures, or a certain step or steps can be removed from these procedures.

本发明第一方面涉及一种步骤流程如图1所示的基于脉冲神经网络的物体运动趋势感知方法,包括:The first aspect of the present invention relates to an object motion trend perception method based on a pulse neural network as shown in Figure 1, including:

获取物体当前所在区域索引;Get the index of the area where the object is currently located;

将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information;

FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface;

具体而言,在本申请实施例中,由PC通过事件信息判断物体当前所在区域索引,其中,事件信息可以由传感器,例如事件相机获得。由某区域内事件数的量判断物体所在区域,并实时记录该区域索引,如(6,5)、(4,12)。将所述区域索引经过二进制编码生成脉冲信息。FPGA作为脉冲信息和PAICORE2.0需要的帧的转化器,将帧通过PCIe接口(2.5GT/s)发送至PAICORE2.0。Specifically, in the embodiment of the present application, the PC judges the index of the area where the object is currently located based on the event information, where the event information can be obtained by a sensor, such as an event camera. The area where the object is located is judged by the number of events in a certain area, and the index of the area is recorded in real time, such as (6,5), (4,12). Binary encoding is performed on the region index to generate pulse information. As a converter of pulse information and frames required by PAICORE2.0, FPGA sends frames to PAICORE2.0 through PCIe interface (2.5GT/s).

所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The PAICORE 2.0 analyzes the frame information and performs inference to generate the position information of the object at the next moment.

具体而言,在本申请实施例中,利用python编程构建场景,模拟现实中拦截乒乓球。乒乓球以任意角度和任意速度由外界射入亚克力板上,滑块预测乒乓球运动趋势和最终到达位置,在相应预测位置拦截乒乓球,如图2所示。Specifically, in the embodiment of the present application, python programming is used to construct a scene, simulating the interception of a table tennis ball in reality. Ping-pong balls are shot into the acrylic board from the outside at any angle and speed. The slider predicts the movement trend and final arrival position of the ping-pong ball, and intercepts the ping-pong ball at the corresponding predicted position, as shown in Figure 2.

在这个过程中,主要用到了pygame.init()初始化pygame;pygame.display.se t_mode([1280,800])设置背景幕布大小为1280×800,幕布大小与硬件部署时事件相机分辨率一致;pygame.Rect(1280/2-80,800-160,160,160)建立正方形乒乓球,宽度和高度都为160;pygame.Rect(-80,0,320,40)建立长方形滑块,宽度为320,高度为40;pygame.font.Font()设置字体;pygame.time.Clock()设置时钟;pygame.draw.ellipse()、pygame.draw.rect()分别在背景上画出乒乓球和滑块,ellipse()命令可以将乒乓球画为圆形,rect()命令将滑块画为条形;pygame.display.flip()更新文字贴图;pygame.image.save()保存当前画面;pygame.display.update()更新整个场景;cv2.imread()读取图片信息。In this process, pygame.init() is mainly used to initialize pygame; pygame.display.se t_mode([1280,800]) sets the size of the background curtain to 1280×800, and the size of the curtain is consistent with the resolution of the event camera during hardware deployment; pygame.Rect(1280/2-80,800-160,160,160) creates a square table tennis ball with a width and height of 160; pygame.Rect(-80,0,320,40) creates a rectangular slider with a width of 320 and a height of 40; pygame. font.Font() sets the font; pygame.time.Clock() sets the clock; pygame.draw.ellipse() and pygame.draw.rect() draw table tennis and sliders on the background respectively, and the ellipse() command can Draw the table tennis ball as a circle, the rect() command draws the slider as a bar; pygame.display.flip() updates the text texture; pygame.image.save() saves the current screen; pygame.display.update() updates The whole scene; cv2.imread() reads the image information.

构建好基础场景后,需要让场景中的乒乓球和滑块运动起来,完成用滑块拦截乒乓球的任务。首先需要设置一套奖励规则,使得当滑块能提前到达预测位置并最终预测成功,拦截到乒乓球时,给予智能体大幅奖励;当滑块不能成功拦截到乒乓球或者没有提前预知到乒乓球的运动趋势时,给予智能体一定惩罚。这套规则为DQN强化学习提供依据,具备状态、动作、收益三个要素。After building the basic scene, it is necessary to move the ping-pong ball and the slider in the scene to complete the task of intercepting the ping-pong ball with the slider. First of all, it is necessary to set a set of reward rules so that when the slider can reach the predicted position in advance and finally predict successfully, and intercept the ping pong ball, the agent will be given a large reward; When the movement trend of , give the agent a certain penalty. This set of rules provides the basis for DQN reinforcement learning, and has three elements: state, action, and income.

利用pygame库和cv2库编程实现上述提到的乒乓球和滑块的运动以及奖励惩罚规则,程序流程图如图3所示。Use the pygame library and the cv2 library to program the above-mentioned table tennis and slider movement and reward and punishment rules. The program flow chart is shown in Figure 3.

在拦截乒乓球任务中,本实施例赋予其100次机会,即从外界向滑块弹射100次乒乓球,当每次滑块拦截到乒乓球,看作成功一次,这样以便未来计算拦截成功率。开始时以随机角度和速度弹射乒乓球,之后乒乓球和滑块按照约束条件依次运动,每次乒乓球和滑块移动后,需要利用规则进行奖励和惩罚,具体规则是:首先判断乒乓球与滑块或底边是否产生碰撞,如果没有碰撞,那么需要计算当前乒乓球距离滑块的距离,利用reward_1=1-(abs(ball.centerx-paddle.centerx)+abs(ball.centery-paddle.centery))/1820语句计算,即两者距离越近,reward_1越大,reward_1最大值为1,最小值为0。如果产生碰撞,需要判断乒乓球是与滑块碰撞还是与底边碰撞,如果乒乓球是与滑块碰撞,则智能体获得加分,此加分根据reward=-1/24*abs(ball.centerx-paddle.centerx)+10语句计算,reward最大值为10,最小值为0,即滑块与乒乓球产生碰撞时,两个中心越接近,说明碰撞效果越好,希望滑块与乒乓球以后都能以这种姿态碰撞。如果乒乓球是与底边碰撞,则智能体获得减分,利用reward=-5语句计算。然后根据reward_all=reward/10.0*0.7+reward_1*0.3统计总得分。这样就完成了一组<状态,动作,收益>的获取。In the intercepting table tennis task, this embodiment gives it 100 chances, that is, ejecting table tennis balls from the outside to the slider 100 times, when the slider intercepts the table tennis ball each time, it is regarded as a success, so that the interception success rate can be calculated in the future . At the beginning, the ping-pong ball is ejected at a random angle and speed, and then the ping-pong ball and the slider move sequentially according to the constraint conditions. After each movement of the ping-pong ball and the slider, rules are used to reward and punish. The specific rules are: Whether there is a collision between the slider or the bottom edge, if there is no collision, then the distance between the current table tennis ball and the slider needs to be calculated, using reward_1=1-(abs(ball.centerx-paddle.centerx)+abs(ball.centery-paddle. centery))/1820 statement calculation, that is, the closer the distance between the two, the greater the reward_1, the maximum value of reward_1 is 1, and the minimum value is 0. If there is a collision, it is necessary to judge whether the ping-pong ball collides with the slider or the bottom edge. If the ping-pong ball collides with the slider, the agent gets extra points. The extra points are based on reward=-1/24*abs(ball. centerx-paddle.centerx)+10 statement calculation, the maximum value of reward is 10, and the minimum value is 0, that is, when the slider collides with the table tennis ball, the closer the two centers are, the better the collision effect is, and it is hoped that the slider and the table tennis ball will collide They will be able to collide in this posture in the future. If the ping-pong ball collides with the bottom edge, the agent gets a minus point, which is calculated using the reward=-5 statement. Then calculate the total score according to reward_all=reward/10.0*0.7+reward_1*0.3. This completes the acquisition of a set of <state, action, benefit>.

模型的主要约束条件集中在乒乓球的运动形式上,另外,本实施例同样也对滑块的拦截运动方式做了一些约束。首先要对每次弹射乒乓球的过程进行约束。开始时以随机角度和速度弹射乒乓球,但要确保整个过程中乒乓球不会运动到场景之外,因此这里对弹射角度和速度做了限制。所作约束如图4所示,每弹射一次乒乓球,不论滑块拦截成功与否,乒乓球都会在随机初始位置刷新,这些位置是在①、②、③号乒乓球这一行任意选择的,使用ball.centerx=random.randint(80,1200)、ball.centery=720两个语句约束这一过程。以②号乒乓球为例,若初始位置刷新至②号位置,则弹射角度允许范围在②→④与②→⑥之间,最小弹射角度为zeta1,最大弹射角度为zeta2。分别用zeta1=math.atan2((80-ball.centery),(80-ball.centerx))、zeta2=math.atan2((80-ball.centery),(1200-ball.centerx))、speed_direction=random.uniform(zeta1,zeta2)三个语句描述随机角度选择的过程。为了适合乒乓球拦截系统部署,这里让弹射速度在6~18任意选择,映射到现实场景就是24cm/s~128cm/s,利用speed=random.uniform(6,18)语句约束。The main constraints of the model focus on the motion form of the table tennis ball. In addition, this embodiment also imposes some constraints on the interception motion of the slider. First of all, it is necessary to constrain the process of each ejection of the table tennis ball. At the beginning, the ping pong ball is ejected at a random angle and speed, but it is necessary to ensure that the ping pong ball does not move out of the scene during the whole process, so the ejection angle and speed are limited here. The constraints made are shown in Figure 4. Every time a ping-pong ball is ejected, regardless of whether the slider intercepts it successfully or not, the ping-pong ball will be refreshed at a random initial position. Ball.centerx=random.randint(80,1200), ball.centery=720 two statements constrain this process. Taking table tennis ball ② as an example, if the initial position is refreshed to position ②, the allowable range of ejection angle is between ②→④ and ②→⑥, the minimum ejection angle is zeta1, and the maximum ejection angle is zeta2. Use zeta1=math.atan2((80-ball.centery), (80-ball.centerx)), zeta2=math.atan2((80-ball.centery), (1200-ball.centerx)), speed_direction= The three statements random.uniform(zeta1, zeta2) describe the process of random angle selection. In order to be suitable for the deployment of the table tennis interception system, here let the ejection speed be arbitrarily selected from 6 to 18, and mapped to the real scene is 24cm/s to 128cm/s, using the speed=random.uniform(6,18) sentence constraint.

乒乓球发射后,会在亚克力板上做直线运动。现实中乒乓球在亚克力板上运动的过程中会受到摩擦力的作用,速度会持续小幅降低,但由于乒乓球在亚克力板上的运动距离很小,乒乓球速度降低幅度有限,因此本专利认为可以将乒乓球的运动形式看作匀速直线运动。根据上述论述,利用ball.centerx+=math.cos(speed_direction)*speed和ball.centery+=math.sin(speed_direction)*speed约束乒乓球的运动形式,以确保乒乓球的运动是匀速直线运动。运动过程中,乒乓球在背景幕布板上的运动角度和速度与每次弹射时的角度和速度一致。After the ping pong ball is launched, it will move in a straight line on the acrylic board. In reality, the table tennis ball will be affected by friction during the movement on the acrylic board, and the speed will continue to decrease slightly. However, because the movement distance of the table tennis ball on the acrylic board is very small, the speed reduction of the table tennis ball is limited. Therefore, this patent believes that The form of motion of table tennis can be regarded as uniform linear motion. According to the above discussion, use ball.centerx+=math.cos(speed_direction)*speed and ball.centery+=math.sin(speed_direction)*speed to constrain the motion form of the table tennis ball to ensure that the motion of the table tennis ball is a uniform linear motion. During the movement, the movement angle and speed of the table tennis ball on the background curtain board are consistent with the angle and speed of each ejection.

现实中滑块的运动形式是三种运动的合成,整个移动过程(由伺服驱动器控制)经历加速直线运动,匀速直线运动和减速直线运动,最终由一个位置到达另一个位置。但是由于滑块运动速度相比于乒乓球运动速度快的多,需要以极快的速度从一个位置移动到另一个位置,因此本实施例将这种运动看作是一种一维跳变运动。滑块移动一次,瞬时位移大小为160。因为幕布的宽度为1280,所以滑块相当于在横向8个位置上可以来回跳动,本实施例将这种运动形式称为“八分位跳变”。In reality, the movement form of the slider is the synthesis of three kinds of movements. The whole movement process (controlled by the servo drive) undergoes accelerated linear motion, uniform linear motion and decelerated linear motion, and finally reaches another position from one position. However, since the movement speed of the slider is much faster than that of the table tennis ball, it needs to move from one position to another at an extremely fast speed, so this embodiment regards this movement as a one-dimensional jumping movement . The slider moves once, and the instantaneous displacement is 160. Because the width of the curtain is 1280, the slider is equivalent to jumping back and forth at 8 positions in the horizontal direction. This embodiment calls this movement form "eighth jump".

在DQN强化学习中,需要用神经网络代替Q-table,所以需要构建神经网络,本实施例的神经网络结构如图5所示。In the DQN reinforcement learning, the Q-table needs to be replaced by a neural network, so a neural network needs to be constructed. The structure of the neural network in this embodiment is shown in FIG. 5 .

整个网络由7层全连接层和6层激活层组成,ReLu()是激活函数;QuantTrainLinear()是量化全连接层,其中两个参数分别是输入特征量和输出特征量。The entire network consists of 7 layers of fully connected layers and 6 layers of activation layers. ReLu() is the activation function; QuantTrainLinear() is the quantized fully connected layer, and the two parameters are input feature quantities and output feature quantities.

网络的输入是由索引转化而来的脉冲信息。索引由二进制编码转化为乒乓球的11位二进制横坐标、10位二进制纵坐标和滑块的11位横坐标,总共32位脉冲信息,将此脉冲信息复制4份,生成128位脉冲信息作为网络的输入。网络的输出是3个特征量,分别表示滑块向右移动一次、滑块静止和滑块向左移动一次。The input of the network is the pulse information converted from the index. The index is converted from binary code into 11-bit binary abscissa, 10-bit binary ordinate, and 11-bit abscissa of the slider, a total of 32-bit pulse information, and this pulse information is copied 4 times to generate 128-bit pulse information as a network input of. The output of the network is 3 feature quantities, which respectively represent the slider moving to the right once, the slider is still and the slider is moving to the left once.

将DQN算法用于神经网络的训练。DQN算法原理如图6所示。Use the DQN algorithm for the training of neural networks. The principle of the DQN algorithm is shown in Figure 6.

将当前脉冲序列和下一脉冲序列分别输入到预测网络和现实网络中,分别计算出三个动作的Q值,取预测网络和现实网络中最大的Q值做均方误差,以此均方误差作为损失函数进行反向传播,更新预测网络的参数,并每隔一段时间将预测网络参数更新到现实网络中。根据DQN算法的原理编写程序训练神经网络,程序流程图如图7所示。Input the current pulse sequence and the next pulse sequence into the prediction network and the actual network respectively, calculate the Q values of the three actions respectively, take the largest Q value in the prediction network and the actual network as the mean square error, and use this mean square error As a loss function, perform backpropagation, update the parameters of the prediction network, and update the parameters of the prediction network to the real network at regular intervals. According to the principle of the DQN algorithm, write a program to train the neural network. The program flow chart is shown in Figure 7.

每次利用DQN训练神经网络的训练量包含500万次状态的更新,所述状态的更新就指滑块和乒乓球运动一次所涉及的各个参数更新一轮的过程。为了充分遍历各种状态,不仅需要每次利用神经网络判断乒乓球运动后滑块的动作(这里动作指滑块向左运动一次、静止不动、向右运动一次三种不同状态),还需要在训练前期加入随机动作,随机使得滑块向左运动一次或静止不动或向右运动一次,以避免DQN强化学习在某些时候陷入局部最优解的僵局。当然,本实施例希望随机赋予滑块动作的操作只在训练最初期发生,因此利用random.randi nt(0,100)<100*(decline**(learn_time/1000))作为判定条件,判定训练过程中是否需要赋予滑块随机动作。如果不需要赋予滑块随机动作,需要将当前状态送入神经网络,经过推理获得滑块的动作。然后再按此动作操作滑块运动、按规则操作乒乓球运动,产生一下状态备用。最后需要将当前状态、下一状态、动作、收益整理存储到数组中,之后迭代神经网络参数时需要使用这些信息。最后还需要不断判断当前得分是否是最高的,如果发现新的最高得分,那么需要储存当前模型,将当前模型作为局部最优模型。The amount of training the neural network using DQN each time includes 5 million state updates, and the state update refers to the process of updating the parameters involved in one movement of the slider and the table tennis ball for one round. In order to fully traverse various states, it is not only necessary to use the neural network to judge the action of the slider after the table tennis movement (here the action refers to the three different states of the slider moving to the left once, standing still, and moving to the right once), but also Add random actions in the early stage of training, and randomly make the slider move to the left once or stay still or move to the right once, so as to avoid the deadlock of DQN reinforcement learning at some point in the local optimal solution. Of course, in this embodiment, it is hoped that the operation of randomly assigning slider actions will only occur at the initial stage of training, so random. Whether to give the slider a random action. If it is not necessary to give the slider a random action, the current state needs to be sent to the neural network, and the action of the slider can be obtained through reasoning. Then operate the slider movement according to this action, operate the table tennis movement according to the rules, and generate a state for standby. Finally, the current state, next state, action, and income need to be sorted and stored in an array, and this information needs to be used when iterating the parameters of the neural network. Finally, it is necessary to constantly judge whether the current score is the highest. If a new highest score is found, the current model needs to be stored and used as the local optimal model.

本实施例中,对于更新预测网络的参数的步骤如下:首先取数组(包含当前状态、下一状态、动作、收益)中任意一段数据,这段数据包含32组<当前状态、下一状态、动作、收益>,也就是说神经网络训练过程是以32组<当前状态、下一状态、动作、收益>为最小单位进行的。然后计算得到32组预测网络和现实网络的Q值,这里分别称为q和q_truth,其中q=net1(b_s).gather(1,b_a),q_next=net2(b_s_).detach().max(1)[0].reshape(b_size,1),q_truth=b_r+gama*q_next*(1-b_done)。损失函数为q和q_truth的最小均方误差,然后进行反向传播更新预测网络参数。训练结束后,将训练好的预测网络模型保存下来,作为当前最优模型。在训练过程中,每过一段时间就要把预测网络的参数赋给现实网络,现实网络不参与训练过程,只有预测网络使用梯度下降法进行反向传播更新网络参数。In this embodiment, the steps for updating the parameters of the prediction network are as follows: First, any piece of data in the array (including current state, next state, action, and income) is taken. This piece of data includes 32 groups<current state, next state, action, income>, that is to say, the neural network training process is carried out with 32 groups <current state, next state, action, income> as the minimum unit. Then calculate the Q value of 32 sets of prediction network and real network, which are called q and q_truth respectively, where q=net1(b_s).gather(1,b_a), q_next=net2(b_s_).detach().max( 1)[0].reshape(b_size, 1), q_truth=b_r+gama*q_next*(1-b_done). The loss function is the minimum mean square error of q and q_truth, and then backpropagation is performed to update and predict network parameters. After the training, save the trained prediction network model as the current optimal model. During the training process, the parameters of the prediction network must be assigned to the real network every once in a while. The real network does not participate in the training process, and only the prediction network uses the gradient descent method to perform backpropagation to update network parameters.

网络训练完毕之后,需要将神经网络化转换为脉冲神经网络。脉冲神经网络由脉冲神经元连接构成,脉冲神经元模型由生物神经元抽象而来,生物神经元树突接收上一个神经元突触释放的神经递质,产生电信号形态刺激,传入胞体后产生动作电位,动作电位经轴突传递至突触,继续向下一个神经元释放神经递质,完成电信号-化学信号相互转换的传递过程。生物神经元至脉冲神经元的抽象过程如图8所示。After the network is trained, it is necessary to convert the neural network into a spiking neural network. The spiking neural network is composed of spiking neuron connections. The spiking neuron model is abstracted from biological neurons. The dendrites of biological neurons receive the neurotransmitter released by the synapse of the previous neuron, generate electrical signal form stimulation, and transmit it to the cell body. The action potential is generated, and the action potential is transmitted to the synapse through the axon, and continues to release neurotransmitters to the next neuron, completing the transmission process of electrical signal-chemical signal conversion. The abstract process from biological neuron to spiking neuron is shown in Figure 8.

抽象后的脉冲神经元模型如图9所示,其中输入为脉冲序列,多个脉冲输入经过相应的权重累加,使神经元胞体产生膜电位,当这个膜电位超过一定阈值时,胞体发放脉冲。The abstracted spiking neuron model is shown in Figure 9, where the input is a pulse sequence, and multiple pulse inputs are accumulated with corresponding weights to make the neuron cell body generate a membrane potential. When the membrane potential exceeds a certain threshold, the cell body emits a pulse.

PAICORE2.0支持LIF神经元模型,其模型可用以下公式表示:PAICORE2.0 supports the LIF neuron model, and its model can be expressed by the following formula:

其中t表示时间步长,n表示网络的层,wij表示网络中前层的第j个神经元到后层第i个神经元的权重,oj表示第j个神经元的输出,值为1表示发放脉冲,值为0表示不发放脉冲。ui表示第i个神经元的膜电位。其中f(·)为衰减函数,g(·)为激活函数,分别代表泄露和超过阈值发放脉冲的过程。脉冲发放后膜电位归零,如果没有脉冲发放,膜电位随时间自然泄露。Where t represents the time step, n represents the layer of the network, w ij represents the weight from the jth neuron in the front layer to the i-th neuron in the back layer in the network, o j represents the output of the jth neuron, and the value is A value of 1 indicates that a pulse is issued, and a value of 0 indicates that no pulse is issued. u i represents the membrane potential of the ith neuron. Among them, f(·) is the decay function, and g(·) is the activation function, which respectively represent the process of leaking and emitting pulses exceeding the threshold. After the pulse is delivered, the membrane potential returns to zero. If there is no pulse, the membrane potential leaks naturally over time.

ANN(人工神经网络)与SNN(脉冲神经网络)的计算模式对比如图10所示,ANN与SNN具有相同网络结构、权重和偏置,不同之处在于ANN的输入和输出为单个浮点数,而SNN的输入和输出为一串脉冲序列,因此如果需要将AN N转换为SNN,需要为SNN选择合适的timestep和Vthr。timestep越大,转换得到的SNN精度就越接近原始的ANN,但考虑到效率问题,timestep不能很大。Vthr可以选择膜电位曾经达到的最大值,或者膜电位最大值的a(0<a<1)倍,还可以通过多次尝试选择最好的Vthr。The calculation mode comparison of ANN (artificial neural network) and SNN (spiking neural network) is shown in Figure 10. ANN and SNN have the same network structure, weight and bias, the difference is that the input and output of ANN are single floating point numbers, The input and output of SNN are a series of pulse sequences, so if you need to convert ANN to SNN, you need to select the appropriate timestep and Vthr for SNN. The larger the timestep, the closer the precision of the converted SNN is to the original ANN, but considering the efficiency, the timestep cannot be very large. Vthr can choose the maximum value that the membrane potential has ever reached, or a (0<a<1) times the maximum value of the membrane potential, and the best Vthr can be selected through multiple attempts.

在实施例的转化方案中,timestep选择为64,Vthr利用迭代的方式确定,Vthr为ANN每层推理结果和SNN每层推理结果最相似时的值。然后通过创建量化器、创建转换器、使用transformer的init_dag方法解析ANN、使用transform er的quantize方法进行量化、使用transformer的generate_snn方法生成SNN这几个过程最后生成SNN。将SNN转化为计算图、再转化为片上网络即可得到PAICORE2.0上网络的具体映射。In the conversion scheme of the embodiment, the timestep is selected as 64, and Vthr is determined in an iterative manner, and Vthr is the value when the reasoning result of each layer of ANN is most similar to the reasoning result of each layer of SNN. Then through the process of creating a quantizer, creating a converter, using the transformer's init_dag method to parse the ANN, using the transformer's quantize method to quantify, and using the transformer's generate_snn method to generate the SNN, the SNN is finally generated. The specific mapping of the network on PAICORE2.0 can be obtained by converting SNN into a calculation graph and then into an on-chip network.

将映射部署到PAICORE2.0上完成网络配置需要向PAICORE2.0发送配置帧。完成网络配置之后,需要给PAICORE2.0送入输入数据,PAICORE2.0接受的输入为工作帧形式。每次推理后的结果需要转化为帧送给FPGA,通过PCIe接口送给PAICORE2.0,完成一次输入,PAICORE2.0解析帧后进行推理,然后输出工作帧经FPGA给回,如此循环就可以实现运动趋势感知系统的运转。Deploying the mapping to PAICORE2.0 to complete network configuration requires sending configuration frames to PAICORE2.0. After completing the network configuration, input data needs to be sent to PAICORE2.0, and the input accepted by PAICORE2.0 is in the form of working frames. The result after each inference needs to be converted into a frame and sent to the FPGA, and sent to PAICORE2.0 through the PCIe interface. After completing an input, PAICORE2.0 analyzes the frame and performs inference, and then outputs the working frame and sends it back through the FPGA. This cycle can be realized The operation of the motion trend perception system.

本申请可应用于各种物体运动趋势感知的场景,以乒乓球拦截场景为例,以事件相机作为传感器,输入事件信息,基于通用性考虑,可以将脉冲神经网络部署至现有常见的平台上,例如Jetson Xavier NX。This application can be applied to various scenarios of object motion trend perception. Taking the table tennis interception scene as an example, the event camera is used as the sensor to input event information. Based on the consideration of versatility, the pulse neural network can be deployed on the existing common platforms. , such as Jetson Xavier NX.

本发明另一方面还涉及基于脉冲神经网络的物体运动趋势感知系统,其结构如图2所示,包括:Another aspect of the present invention also relates to an object movement trend perception system based on a pulse neural network, its structure is shown in Figure 2, including:

输入模块,用于获取物体当前所在区域索引;The input module is used to obtain the index of the area where the object is currently located;

将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information;

FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface;

处理模块,用于所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The processing module is used for the PAICORE2.0 to analyze the frame information and perform inference to generate the position information of the object at the next moment.

所述输入模块还用于由PC通过事件信息判断物体当前所在区域索引,其中,所述事件信息的获取方法包括采用传感器进行获取。The input module is also used for judging the index of the area where the object is currently located by the PC through the event information, wherein the method for obtaining the event information includes using a sensor to obtain.

所述系统还包括输出模块,用于将所述位置信息通过所述FPGA传回至PC,解析得到与所述位置信息对应的位置索引。The system further includes an output module, configured to transmit the location information back to the PC through the FPGA, and analyze to obtain a location index corresponding to the location information.

具体而言,本实施例中,整套系统主要分为三个模块,依次进行信息传递与处理,分别是输入模块、处理模块、输出模块。系统用于预测乒乓球运动趋势(乒乓球由外界朝向滑轨射入亚克力板上,在亚克力板上做二维平面匀速直线运动),并用滑块拦截运动中的乒乓球。Specifically, in this embodiment, the entire system is mainly divided into three modules, which carry out information transmission and processing in sequence, namely an input module, a processing module, and an output module. The system is used to predict the movement trend of the table tennis ball (the table tennis ball is shot into the acrylic board from the outside towards the slide rail, and makes a two-dimensional plane uniform linear motion on the acrylic board), and uses the slider to intercept the table tennis ball in motion.

输入模块是事件相机。输入模块主要用于获取乒乓球和滑块在亚克力板上实时位置,将事件流信息输入给AI边缘计算设备;处理模块是AI边缘计算设备。处理模块主要用于处理输入模块输入的事件流并转化为脉冲流,通过其上部署的脉冲神经网络计算,预测出乒乓球的运动轨迹和滑块拦截位置,并向输出模块发送滑块拦截位置指令;输出模块由单片机、伺服驱动器、伺服电机、滑轨与滑块、开关电源组成。单片机接收处理模块发送的滑块拦截位置指令,形成控制信号并实时发送给伺服驱动器,由伺服驱动器驱动伺服电机带动滑块移动到相应的拦截位置。系统简化接线图如图12所示。The input module is an event camera. The input module is mainly used to obtain the real-time position of the table tennis ball and the slider on the acrylic board, and input the event flow information to the AI edge computing device; the processing module is the AI edge computing device. The processing module is mainly used to process the event flow input by the input module and convert it into a pulse flow. Through the calculation of the pulse neural network deployed on it, the trajectory of the table tennis ball and the interception position of the slider are predicted, and the interception position of the slider is sent to the output module. Command; the output module is composed of single-chip microcomputer, servo driver, servo motor, slide rail and slider, and switching power supply. The single-chip microcomputer receives the slider interception position instruction sent by the processing module, forms a control signal and sends it to the servo driver in real time, and the servo driver drives the servo motor to drive the slider to move to the corresponding interception position. The simplified wiring diagram of the system is shown in Figure 12.

输入模块程序流程图如图13所示。The flow chart of the input module program is shown in Figure 13.

处理模块程序流程图如图14所示。The program flow chart of the processing module is shown in Figure 14.

输出模块程序流程图如图15所示。The program flow chart of the output module is shown in Figure 15.

最终实测系统参数如图16所示。The final measured system parameters are shown in Figure 16.

通过使用该系统,能够执行上述的运算处理方法并实现对应的技术效果。By using the system, it is possible to execute the above-mentioned arithmetic processing method and achieve corresponding technical effects.

本发明的实施例还提供能够实现上述实施例中的基于脉冲神经网络的物体运动趋势感知方法中全部步骤的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中的基于脉冲神经网络的物体运动趋势感知方法的全部步骤。Embodiments of the present invention also provide a computer-readable storage medium capable of implementing all the steps in the method for perceiving object movement trends based on the impulse neural network in the above-mentioned embodiments, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, all the steps of the method for sensing the movement trend of an object based on the spiking neural network in the above-mentioned embodiments are realized.

本发明的实施例还提供一种用于执行上述方法的电子设备,作为该方法的实现装置,所述电子设备至少具备有处理器和存储器,特别是该存储器上存储有执行方法所需的数据和相关的计算机程序等,并通过由处理器调用存储器中的数据、程序执行实现方法的全部步骤,并获得对应的技术效果。An embodiment of the present invention also provides an electronic device for performing the above method. As an implementation device of the method, the electronic device is at least equipped with a processor and a memory, and in particular, the memory stores data required for executing the method. and related computer programs, etc., all the steps of the method are realized by calling the data in the memory by the processor, and the program is executed, and corresponding technical effects are obtained.

优选的,该电子设备可以包含有总线架构,总线可以包括任意数量的互联的总线和桥,总线将包括由一个或多个处理器和存储器的各种电路链接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和接收器和发送器之间提供接口。接收器和发送器可以是同一个元件,即收发机,提供用于在传输介质上与各种其他系统通信的单元。处理器负责管理总线和通常的处理,而存储器可以被用于存储处理器在执行操作时所使用的数据。Preferably, the electronic device may include a bus architecture, and the bus may include any number of interconnected buses and bridges, and the bus may link together various circuits including one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter can be the same element, a transceiver, providing means for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while memory may be used to store data that the processor uses when performing operations.

额外的,所述电子设备还可以进一步包括通信模块、输入单元、音频处理器、显示器、电源等部件。其所采用的处理器(或称为控制器、操作控件)可以包括微处理器或其他处理器装置和/或逻辑装置,该处理器接收输入并控制电子设备的各个部件的操作;存储器可以是缓存器、闪存、硬驱、可移动介质、易失性存储器、非易失性存储器或其它合适装置中的一种或更多种,可储存上述有关的数据信息,此外还可存储执行有关信息的程序,并且处理器可执行该存储器存储的该程序,以实现信息存储或处理等;输入单元用于向处理器提供输入,例如可以为按键或触摸输入装置;电源用于向电子设备提供电力;显示器用于进行图像和文字等显示对象的显示,例如可为LCD显示器。通信模块即为经由天线发送和接收信号的发送机/接收机。通信模块(发送机/接收机)耦合到处理器,以提供输入信号和接收输出信号,这可以和常规移动通信终端的情况相同。基于不同的通信技术,在同一电子设备中,可以设置有多个通信模块,如蜂窝网络模块、蓝牙模块和/或无线局域网模块等。通信模块(发送机/接收机)还经由音频处理器耦合到扬声器和麦克风,以经由扬声器提供音频输出,并接收来自麦克风的音频输入,从而实现通常的电信功能。音频处理器可以包括任何合适的缓冲器、解码器、放大器等。另外,音频处理器还耦合到中央处理器,从而使得可以通过麦克风能够在本机上录音,且使得可以通过扬声器来播放本机上存储的声音。Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or called controller, operation control) adopted by it may include a microprocessor or other processor devices and/or logic devices, which receive input and control the operation of various components of the electronic equipment; the memory may be One or more of buffer memory, flash memory, hard drive, removable media, volatile memory, non-volatile memory or other suitable devices, which can store the above-mentioned relevant data information, and can also store execution-related information program, and the processor can execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, such as a button or a touch input device; the power supply is used to provide power to electronic equipment ; The display is used for displaying display objects such as images and text, for example, it may be an LCD display. A communication module is a transmitter/receiver that sends and receives signals via an antenna. A communication module (transmitter/receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as in conventional mobile communication terminals. Based on different communication technologies, multiple communication modules, such as a cellular network module, a bluetooth module and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) is also coupled to a speaker and a microphone via an audio processor to provide audio output via the speaker and receive audio input from the microphone for usual telecommunication functions. Audio processors may include any suitable buffers, decoders, amplifiers, etc. In addition, the audio processor is also coupled to the central processing unit, so that the recording on the machine can be made through the microphone, and the sound stored on the machine can be played through the speaker.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的系统。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a A system for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令系统的制造品,该指令系统实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising a system of instructions, the The system implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams. While preferred embodiments of the present invention have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.

以上所述仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换等都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto, any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention etc. should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (10)

1.一种基于脉冲神经网络的物体运动趋势感知方法,其特征在于,包括:1. A method for sensing the motion trend of an object based on a pulse neural network, characterized in that it comprises: 获取物体当前所在区域索引;Get the index of the area where the object is currently located; 将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information; FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface; 所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The PAICORE 2.0 analyzes the frame information and performs inference to generate the position information of the object at the next moment. 2.如权利要求1所述的方法,其特征在于,所述PAICORE2.0是部署有脉冲神经网络模型的类脑芯片,用于实现脉冲神经网络功能。2. The method according to claim 1, wherein the PAICORE2.0 is a brain-inspired chip deployed with a spiking neural network model for realizing the spiking neural network function. 3.如权利要求1所述的方法,其特征在于,所述获取物体当前所在区域索引,包括:由PC通过事件信息判断物体当前所在区域索引,其中,所述事件信息的获取方法包括采用传感器进行获取。3. The method according to claim 1, wherein said obtaining the index of the area where the object is currently located comprises: judging the index of the area where the object is currently located by the PC through event information, wherein the method for acquiring the event information includes using a sensor Get it. 4.如权利要求2所述的方法,其特征在于,所述方法还包括:将所述位置信息通过所述FPGA传回至PC,解析得到与所述位置信息对应的位置索引。4. The method according to claim 2, further comprising: sending the location information back to the PC through the FPGA, and analyzing to obtain a location index corresponding to the location information. 5.如权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:利用DQN训练神经网络,将所述神经网络化转换为所述脉冲神经网络。5. The method according to any one of claims 1 to 4, further comprising: using DQN to train a neural network, and converting the neural network into the spiking neural network. 6.如权利要求2所述的方法,其特征在于,所述PAICORE2.0支持LIF神经元模型。6. The method according to claim 2, wherein the PAICORE2.0 supports the LIF neuron model. 7.一种基于脉冲神经网络的物体运动趋势感知系统,其特征在于,包括:7. An object motion trend perception system based on a pulse neural network, characterized in that it comprises: 输入模块,用于获取物体当前所在区域索引;The input module is used to obtain the index of the area where the object is currently located; 将所述区域索引经过二进制编码生成脉冲信息;Binary coding the region index to generate pulse information; FPGA将所述脉冲信息转化为帧信息通过PCIe接口发送至PAICORE2.0;The FPGA converts the pulse information into frame information and sends it to PAICORE2.0 through the PCIe interface; 处理模块,用于所述PAICORE2.0解析所述帧信息并进行推理,生成下一时刻所述物体的位置信息。The processing module is used for the PAICORE2.0 to analyze the frame information and perform inference to generate the position information of the object at the next moment. 8.一种计算机可读存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法。8. A computer-readable storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented. 9.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6任一项所述方法。9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, characterized in that, when the processor executes the computer program, any one of claims 1 to 6 is realized. method described in the item. 10.一种计算机程序产品,包括计算机程序和/或指令,其特征在于,该计算机程序和/或指令被处理器执行时实现权利要求1至6中任一项所述方法的步骤。10. A computer program product, comprising computer programs and/or instructions, characterized in that, when the computer programs and/or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
CN202310235879.7A 2023-03-13 2023-03-13 Object motion trend sensing method and system based on impulse neural network Active CN116611481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310235879.7A CN116611481B (en) 2023-03-13 2023-03-13 Object motion trend sensing method and system based on impulse neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310235879.7A CN116611481B (en) 2023-03-13 2023-03-13 Object motion trend sensing method and system based on impulse neural network

Publications (2)

Publication Number Publication Date
CN116611481A true CN116611481A (en) 2023-08-18
CN116611481B CN116611481B (en) 2025-09-09

Family

ID=87682476

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310235879.7A Active CN116611481B (en) 2023-03-13 2023-03-13 Object motion trend sensing method and system based on impulse neural network

Country Status (1)

Country Link
CN (1) CN116611481B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113989671A (en) * 2021-10-28 2022-01-28 西安电子科技大学 Remote sensing scene classification method and system based on semantic perception and dynamic graph convolution
US20230051066A1 (en) * 2021-07-27 2023-02-16 Lemon Inc. Partitioning Information In Neural Network-Based Video Coding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230051066A1 (en) * 2021-07-27 2023-02-16 Lemon Inc. Partitioning Information In Neural Network-Based Video Coding
CN113989671A (en) * 2021-10-28 2022-01-28 西安电子科技大学 Remote sensing scene classification method and system based on semantic perception and dynamic graph convolution

Also Published As

Publication number Publication date
CN116611481B (en) 2025-09-09

Similar Documents

Publication Publication Date Title
US20180075345A1 (en) Spatio-temporal spiking neural networks in neuromorphic hardware systems
CN112052948B (en) Network model compression method and device, storage medium and electronic equipment
CN112347923A (en) A Roadside Pedestrian Trajectory Prediction Algorithm Based on Adversarial Generative Network
CN108470190A (en) The image-recognizing method of impulsive neural networks is customized based on FPGA
CN109948526A (en) Image processing method and device, detection device and storage medium
KR102694572B1 (en) Method and apparatus for controlling data input and output of fully connected network
Li et al. L-DETR: a light-weight detector for end-to-end object detection with transformers
CN111260075A (en) Artificial intelligent method and system for machine simulation of learning and working of target to be simulated
Morris et al. HyperSpike: Hyperdimensional computing for more efficient and robust spiking neural networks
Huang et al. Real-time radar gesture classification with spiking neural network on SpiNNaker 2 prototype
Wang 3D dynamic image modeling based on machine learning in film and television animation
Jiang et al. A data-efficient goal-directed deep reinforcement learning method for robot visuomotor skill
Zhao et al. Impact makes a sound and sound makes an impact: Sound guides representations and explorations
CN113988276A (en) Target identification method and system
Rosser et al. Implementation of strangely behaving intelligent agents to determine human intervention during reinforcement learning
CN117475493A (en) Emotion recognition method and device, electronic equipment, chip and medium
CN116611481A (en) Object motion trend sensing method and system based on impulse neural network
CN111760276B (en) Game behavior control method, device, terminal, server and storage medium
Artemov et al. Subsystem for simple dynamic gesture recognition using 3DCNNLSTM
CN117784010A (en) A sound source localization method and system based on pulse neural network
CN118710786A (en) A digital human motion generation method and generation system
CN115327917B (en) Machine animal control method, controller and machine animal
Barman et al. Dynamite: A testbed for multiple mobile robots
Elshaw et al. An associator network approach to robot learning by imitation through vision, motor control and language
CN223251653U (en) Bionic service type humanoid robot eye structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant