[go: up one dir, main page]

CN116503719A - Method and device for identifying connection relation of circuit experimental device - Google Patents

Method and device for identifying connection relation of circuit experimental device Download PDF

Info

Publication number
CN116503719A
CN116503719A CN202310229660.6A CN202310229660A CN116503719A CN 116503719 A CN116503719 A CN 116503719A CN 202310229660 A CN202310229660 A CN 202310229660A CN 116503719 A CN116503719 A CN 116503719A
Authority
CN
China
Prior art keywords
circuit
circuit experiment
wire
directed graph
experimental
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.)
Pending
Application number
CN202310229660.6A
Other languages
Chinese (zh)
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.)
Shanghai Xiding Intelligent Technology Co ltd
Original Assignee
Shanghai Xiding Intelligent Technology Co ltd
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 Shanghai Xiding Intelligent Technology Co ltd filed Critical Shanghai Xiding Intelligent Technology Co ltd
Priority to CN202310229660.6A priority Critical patent/CN116503719A/en
Publication of CN116503719A publication Critical patent/CN116503719A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B23/00Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes
    • G09B23/06Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes for physics
    • G09B23/18Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes for physics for electricity or magnetism
    • G09B23/183Models for scientific, medical, or mathematical purposes, e.g. full-sized devices for demonstration purposes for physics for electricity or magnetism for circuits
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection
    • 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
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computational Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Algebra (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Educational Administration (AREA)
  • Educational Technology (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种电路实验器件连接关系的识别方法,包括:获取电路实验图片;对电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果;根据目标识别结果和实例分割结果构建电路实验对应的有向图;以及基于有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。本方案能够提高复杂场景下电学实验器件之间连接关系识别的准确性。

The invention discloses a method for identifying the connection relationship of circuit experiment devices, comprising: obtaining circuit experiment pictures; performing target detection and instance segmentation on the circuit experiment pictures, and obtaining target recognition results including circuit experiment devices and connected terminal posts and connected The instance segmentation result of the wire; construct the directed graph corresponding to the circuit experiment according to the target recognition result and the instance segmentation result; and judge the series-parallel connection relationship between the circuit experiment devices based on the directed path of each experimental device in the directed graph. The solution can improve the accuracy of identifying the connection relationship between electrical experimental devices in complex scenarios.

Description

一种电路实验器件连接关系的识别方法和装置A method and device for identifying the connection relationship of circuit experiment devices

技术领域technical field

本发明涉及电路检测技术领域,具体涉及一种电路实验器件连接关系的识别方法、装置、计算设备及存储介质。The invention relates to the technical field of circuit detection, in particular to a method, device, computing device and storage medium for identifying the connection relationship of circuit experimental devices.

背景技术Background technique

在中学物理电学实验教学或考试中,导线是常用的实验器件,相关的实验考试测评中,电路中的电流方向、电学实验设备之间的串并联关系是考察重点。因此,能够正确判断电路中设备器件之间的串并联连接关系至关重要。In the teaching or examination of physics and electricity experiments in middle schools, wires are commonly used experimental devices. In related experimental examinations and evaluations, the current direction in the circuit and the series-parallel relationship between electrical experimental equipment are the focus of investigation. Therefore, it is very important to be able to correctly judge the series-parallel connection relationship between devices and devices in the circuit.

目前主要基于图像的目标检测、语义分割等方法直接进行电路设备之间连接关系的检测。但是该方案在电学实验设备数量较多、连接关系多样化的情况下,存在识别准确度低的问题。At present, methods such as image-based object detection and semantic segmentation are mainly used to directly detect the connection relationship between circuit devices. However, this scheme has the problem of low recognition accuracy when the number of electrical experimental equipment is large and the connection relationship is diverse.

因此,需要提供一种电路实验器件连接关系的识别方法,能够在复杂场景下对电路实验器件之间的连接关系进行准确识别,以解决现有技术中存在的问题。Therefore, it is necessary to provide a method for identifying the connection relationship between circuit experiment devices, which can accurately identify the connection relationship between circuit experiment devices in complex scenarios, so as to solve the problems existing in the prior art.

发明内容Contents of the invention

鉴于上述问题,本发明提出一种克服上述问题或者至少部分地解决上述问题的一种电路实验器件连接关系的识别方法、装置、计算设备及存储介质,通过将目标检测、实例分割与有向图构建结合,能够动态构建基于实验电路的有向图,并根据构建的有向图数据进行实验器件有向路径的遍历,从而准确判断电路实验器件之间的串并联连接关系,能够适用于复杂识别场景下的实验电路连接状态的检测。In view of the above problems, the present invention proposes a method, device, computing device and storage medium for identifying the connection relationship of circuit experiment devices that overcome the above problems or at least partially solve the above problems, by combining target detection, instance segmentation and directed graph The combination of construction can dynamically construct a directed graph based on the experimental circuit, and traverse the directed path of the experimental device according to the constructed directed graph data, so as to accurately judge the series-parallel connection relationship between the circuit experimental devices, which can be applied to complex identification The detection of the connection state of the experimental circuit in the scene.

根据本发明的第一方面,提供一种电路实验器件连接关系的识别方法,首先,获取电路实验图片;然后,对电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果;接着,根据所述目标识别结果和实例分割结果构建电路实验对应的有向图;最后,基于有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。According to the first aspect of the present invention, a method for identifying the connection relationship of circuit experiment devices is provided. First, the circuit experiment picture is obtained; The target recognition result and the instance segmentation result of the connected wire; then, construct the directed graph corresponding to the circuit experiment according to the target recognition result and the instance segmentation result; finally, based on the directed path of each experimental device in the directed graph, judge The series-parallel connection relationship between circuit experiment devices.

通过上述技术方案,通过对电路实验图片进行更加细粒度的目标检测和实例分割,能够更加准确的确定实验图片中各实验器件、接线柱与导线的位置关系。并根据目标识别结果和实例分割结果构建各个实验器件之间的有向图数据,能够更加形象地表达电路实验的真实描述,从而根据有向图数据更加准确地确定电路实验器件之间的连接关系。Through the above technical solution, by performing more fine-grained target detection and instance segmentation on the circuit experiment picture, the positional relationship of each experimental device, terminal and wire in the experiment picture can be determined more accurately. And according to the target recognition results and instance segmentation results, the directed graph data between each experimental device can be constructed, which can express the true description of the circuit experiment more vividly, so that the connection relationship between the circuit experimental devices can be more accurately determined according to the directed graph data .

可选地,在上述方法中,可以用将电路实验图片输入预先训练好的第一目标检测模型中,得到电路实验器件检测框;将包含电路实验器件检测框的电路实验图片输入预先训练好的第二目标检测模型中,得到已连接接线柱检测框;以及将包含电路实验器件检测框和已连接接线柱检测框的电路实验图片输入预先训练好的实例分割模型中,得到已连接导线识别结果。Optionally, in the above method, the circuit test picture can be input into the pre-trained first target detection model to obtain the circuit test device detection frame; the circuit test picture containing the circuit test device detection frame can be input into the pre-trained In the second target detection model, the connected terminal detection frame is obtained; and the circuit experiment picture including the circuit experiment device detection frame and the connected terminal detection frame is input into the pre-trained instance segmentation model, and the connected wire recognition result is obtained .

通过更加细粒度的目标检测和实例分割,能够降低深度学习模型的特征提取难度,并提高不同目标识别的准确性。Through finer-grained target detection and instance segmentation, the difficulty of feature extraction for deep learning models can be reduced, and the accuracy of different target recognition can be improved.

可选地,在上述方法中,第一目标检测模型和第二目标检测模型为Faster-RCNN、YOLO、SSD、Cornernet中任意一种,实例分割模型为mask RCNN、cascade RCNN中任意一种。Optionally, in the above method, the first target detection model and the second target detection model are any of Faster-RCNN, YOLO, SSD, and Cornernet, and the instance segmentation model is any of mask RCNN and cascade RCNN.

可选地,在上述方法中,将电路实验器件作为有向图的顶点;根据已连接接线柱和已连接导线确定导线中的电流方向,作为有向图的边。Optionally, in the above method, the circuit experimental device is used as the vertex of the directed graph; the current direction in the wire is determined according to the connected terminal and the connected wire as the edge of the directed graph.

可选地,在上述方法中,接线柱包括已连接红色接线柱、已连接黑色接线柱、已连接接线柱,可以将导线从已连接黑色接线柱到已连接红色接线柱的方向确定为电流方向;将导线从已连接黑色接线柱到已连接接线柱的方向确定为电流方向;将导线从已连接接线柱到已连接红色接线柱的方向确定为电流方向,生成初始有向图。Optionally, in the above method, the terminals include the connected red terminal, the connected black terminal, and the connected terminal, and the direction of the wire from the connected black terminal to the connected red terminal can be determined as the current direction ; Determine the direction of the wire from the connected black terminal to the connected terminal as the current direction; determine the direction of the wire from the connected terminal to the connected red terminal as the current direction, and generate an initial directed graph.

可选地,在上述方法中,如果导线两端都是已连接红色接线柱,则对初始有向图进行逆向查询;如果导线两端都是已连接黑色接线柱,则对初始有向图进行正向查询;如果导线两端都是已连接接线柱,则在电路实验器件之间增加一条双向边。Optionally, in the above method, if both ends of the wire are connected to red binding posts, perform a reverse query on the initial directed graph; if both ends of the wire are connected to black binding posts, perform a reverse query on the initial directed graph Positive query; if both ends of the wire are connected terminals, add a bi-directional edge between circuit experimental devices.

可选地,在上述方法中,对于有向图中实验器件进行路径查询,直到查询路径回到实验器件;若第一实验器件的查询路径中不包含第二实验器件,则确定第一实验器件与第二实验器件之间为并联关系;若第一实验器件的查询路径中包含第二实验器件,则确定第一实验器件与第二实验器件之间为串联关系。Optionally, in the above method, the path query is performed on the experimental device in the directed graph until the query path returns to the experimental device; if the query path of the first experimental device does not include the second experimental device, then the first experimental device is determined It is in a parallel relationship with the second experimental device; if the query path of the first experimental device includes the second experimental device, it is determined that the first experimental device and the second experimental device are in a serial relationship.

根据本发明的第二方面,提供一种电路实验器件连接关系的识别装置,包括:获取模块、检测模块、构建模块和判断模块。According to the second aspect of the present invention, there is provided a device for identifying the connection relationship of circuit experimental devices, including: an acquisition module, a detection module, a construction module and a judgment module.

其中,获取模块,用于获取电路实验图片;检测模块,用于对电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果;构建模块,用于根据目标识别结果和实例分割结果构建电路实验对应的有向图;以及判断模块,用于基于有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。Among them, the acquisition module is used to obtain the circuit experiment picture; the detection module is used to perform target detection and instance segmentation on the circuit experiment picture, and obtain the target recognition result including the circuit experiment device, the connected terminal post and the instance segmentation result of the connected wire ; a building module, used to construct a directed graph corresponding to the circuit experiment according to the target recognition result and the instance segmentation result; Parallel connections.

根据本发明的第三方面,提供一种计算设备,包括:至少一个处理器;和存储有程序指令的存储器,其中,程序指令被配置为适于由至少一个处理器执行,程序指令包括用于执行上述电路实验器件连接关系的识别方法的指令。According to a third aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising Execute the instructions of the method for identifying the connection relationship of the above-mentioned circuit experiment devices.

根据本发明的第四方面,提供一种存储有程序指令的可读存储介质,当程序指令被计算设备读取并执行时,使得计算设备执行上述的电路实验器件连接关系的识别方法。According to a fourth aspect of the present invention, there is provided a readable storage medium storing program instructions. When the program instructions are read and executed by a computing device, the computing device executes the above-mentioned method for identifying the connection relationship of circuit experimental devices.

根据本发明的方案,通过对电路实验图片进行更加细粒度的目标检测和实例分割,能够降低特征提取难度,有利于提高识别准确性;根据识别结果构建有向图,能够更加形象地表达电学实验中电路图连接关系的描述,相比于直接利用深度学习模型进行连接关系的识别,本方案能够提高电学设备之间连接关系识别的准确性,能够适用于复杂场景下的电路实验器件连接关系的准确识别。According to the solution of the present invention, by performing more fine-grained target detection and instance segmentation on the circuit experiment picture, the difficulty of feature extraction can be reduced, which is conducive to improving the recognition accuracy; constructing a directed graph according to the recognition result can express the electrical experiment more vividly In the description of the connection relationship of the circuit diagram, compared with the identification of the connection relationship directly using the deep learning model, this scheme can improve the accuracy of the connection relationship identification between electrical equipment, and can be applied to the accurate connection relationship of circuit experiment devices in complex scenarios. identify.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的计算设备100的结构框图;FIG. 1 shows a structural block diagram of a computing device 100 according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的电路实验器件连接关系的识别方法200的流程示意图;FIG. 2 shows a schematic flow diagram of a method 200 for identifying connection relationships of circuit experiment devices according to an embodiment of the present invention;

图3示出了根据本发明一个实施例的电路实验图片示意图;Fig. 3 shows a schematic diagram of a circuit experiment picture according to an embodiment of the present invention;

图4示出了根据本发明一个实施例的电路实验器件识别结果示意图;Fig. 4 shows a schematic diagram of the identification result of the circuit experiment device according to one embodiment of the present invention;

图5示出了根据本发明一个实施例的接线柱的识别结果示意图;Fig. 5 shows a schematic diagram of a recognition result of a terminal according to an embodiment of the present invention;

图6示出了根据本发明一个实施例的已连接导线识别结果示意图;Fig. 6 shows a schematic diagram of a connected wire identification result according to an embodiment of the present invention;

图7示出了根据本发明一个实施例的电路实验的初始有向图示意图;Figure 7 shows a schematic diagram of an initial directed graph of a circuit experiment according to an embodiment of the present invention;

图8示出了根据本发明一个实施例的电路实验对应的有向图示意图;FIG. 8 shows a schematic diagram of a directed graph corresponding to a circuit experiment according to an embodiment of the present invention;

图9示出了根据本发明一个实施例的电路实验器件连接关系的识别装置900的结构示意图。FIG. 9 shows a schematic structural diagram of an apparatus 900 for identifying connection relationships of circuit experiment devices according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

在中学物理电学实验中,按照电路图连接电路是考察重点,例如利用电流表测电流、利用电压表测电压、利用滑动变阻器改变电路中电流等实验。其中需要判断导线与电表正负极连接的准确性、电学器件之间串并联连接方式是否正确、线路连接是否完整等。In middle school physics and electricity experiments, connecting the circuit according to the circuit diagram is the focus of investigation, such as using an ammeter to measure current, using a voltmeter to measure voltage, and using a sliding rheostat to change the current in the circuit and other experiments. Among them, it is necessary to judge the accuracy of the connection between the wire and the positive and negative poles of the ammeter, whether the series and parallel connection mode between the electrical devices is correct, and whether the line connection is complete.

目前,现有技术中将两个电学设备之间存在连接关系的区域作为目标检测框,利用目标检测技术对上述检测框进行模型训练,将训练得到的目标检测模型直接进行电路设备之间连接关系的识别。由于串联关系和并联关系的目标检测框细节差异特征不明显,会导致特征提取难度大,识别准确性低。At present, in the prior art, the area where there is a connection relationship between two electrical devices is used as the target detection frame, and the target detection technology is used to perform model training on the above detection frame, and the target detection model obtained by training is directly tested for the connection relationship between the circuit devices. identification. Since the difference between the details of the target detection frame in the series relationship and the parallel relationship is not obvious, it will lead to difficulty in feature extraction and low recognition accuracy.

为了提高电路实验器件之间串并联关系识别的准确性,本方案提供了一种电路实验器件连接关系的识别方法,通过使用更加细粒度的目标检测框进行目标检测,并结合动态有向图进行设备之间连接关系的构建,能够更加准确地识别实验器件之间的连接关系。In order to improve the accuracy of identifying the series-parallel relationship between circuit experimental devices, this scheme provides a method for identifying the connection relationship between circuit experimental devices, by using a finer-grained target detection frame for target detection, combined with dynamic directed graphs The construction of the connection relationship between devices can more accurately identify the connection relationship between experimental devices.

图1示出了根据本发明一个实施例的计算设备100的结构图。如图1所示,在基本的配置102中,计算设备100典型地包括系统存储器106和一个或者多个处理器104。存储器总线108可以用于在处理器104和系统存储器106之间的通信。FIG. 1 shows a block diagram of a computing device 100 according to an embodiment of the present invention. As shown in FIG. 1 , in a basic configuration 102 , computing device 100 typically includes system memory 106 and one or more processors 104 . A memory bus 108 may be used for communication between the processor 104 and the system memory 106 .

取决于期望的配置,处理器104可以是任何类型的处理器,包括但不限于:微处理器(µP)、微控制器(µC)、数字信息处理器(DSP)或者它们的任何组合。处理器104可以包括诸如一级高速缓存110和二级高速缓存112之类的一个或者多个级别的高速缓存、处理器核心114和寄存器116。示例的处理器核心114可以包括运算逻辑单元(ALU)、浮点数单元(FPU)、数字信号处理核心(DSP核心)或者它们的任何组合。示例的存储器控制器118可以与处理器104一起使用,或者在一些实现中,存储器控制器118可以是处理器104的一个内部部分。Depending on the desired configuration, processor 104 may be any type of processor including, but not limited to, a microprocessor (µP), microcontroller (µC), digital information processor (DSP), or any combination thereof. Processor 104 may include one or more levels of cache such as L1 cache 110 and L2 cache 112 , processor core 114 and registers 116 . Exemplary processor core 114 may include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 may be used with the processor 104 or, in some implementations, the memory controller 118 may be an internal part of the processor 104 .

取决于期望的配置,系统存储器106可以是任意类型的存储器,包括但不限于:易失性存储器(诸如RAM)、非易失性存储器(诸如ROM、闪存等)或者它们的任何组合。计算设备中的物理内存通常指的是易失性存储器RAM,磁盘中的数据需要加载至物理内存中才能够被处理器104读取。系统存储器106可以包括操作系统120、一个或者多个应用122以及程序数据124。Depending on the desired configuration, system memory 106 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The physical memory in the computing device usually refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before being read by the processor 104 . System memory 106 may include an operating system 120 , one or more applications 122 , and program data 124 .

在一些实施方式中,应用122可以布置为在操作系统上由一个或多个处理器104利用程序数据124执行指令。操作系统120例如可以是Linux、Windows等,其包括用于处理基本系统服务以及执行依赖于硬件的任务的程序指令。应用122包括用于实现各种用户期望的功能的程序指令,应用122例如可以是浏览器、即时通讯软件、软件开发工具(例如集成开发环境IDE、编译器等)等,但不限于此。当应用122被安装到计算设备100中时,可以向操作系统120添加驱动模块。In some implementations, applications 122 may be arranged to execute instructions on an operating system with program data 124 by one or more processors 104 . The operating system 120 may be, for example, Linux, Windows, etc., which includes program instructions for handling basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for realizing various user-desired functions. The application 122 may be, for example, a browser, instant messaging software, software development tools (such as an integrated development environment IDE, a compiler, etc.), but is not limited thereto. When the application 122 is installed into the computing device 100 , a driver module may be added to the operating system 120 .

在计算设备100启动运行时,处理器104会从存储器106中读取操作系统120的程序指令并执行。应用122运行在操作系统120之上,利用操作系统120以及底层硬件提供的接口来实现各种用户期望的功能。当用户启动应用122时,应用122会加载至存储器106中,处理器104从存储器106中读取并执行应用122的程序指令。When the computing device 100 starts to run, the processor 104 reads program instructions of the operating system 120 from the memory 106 and executes them. The application 122 runs on the operating system 120, and utilizes the interface provided by the operating system 120 and the underlying hardware to realize various user-desired functions. When the user starts the application 122 , the application 122 is loaded into the memory 106 , and the processor 104 reads and executes the program instructions of the application 122 from the memory 106 .

计算设备100还包括储存设备132,储存设备132包括可移除储存器136和不可移除储存器138,可移除储存器136和不可移除储存器138均与储存接口总线134连接。Computing device 100 also includes storage device 132 , which includes removable storage 136 and non-removable storage 138 , both of which are connected to storage interface bus 134 .

计算设备100还可以包括有助于从各种接口设备(例如,输出设备142、外设接口144和通信设备146)到基本配置102经由总线/接口控制器130的通信的接口总线140。示例的输出设备142包括图形处理单元148和音频处理单元150。它们可以被配置为有助于经由一个或者多个A/V端口152与诸如显示器或者扬声器之类的各种外部设备进行通信。示例外设接口144可以包括串行接口控制器154和并行接口控制器156,它们可以被配置为有助于经由一个或者多个I/O端口158和诸如输入设备(例如,键盘、鼠标、笔、语音输入设备、触摸输入设备)或者其他外设(例如打印机、扫描仪等)之类的外部设备进行通信。示例的通信设备146可以包括网络控制器160,其可以被布置为便于经由一个或者多个通信端口164与一个或者多个其他计算设备162通过网络通信链路的通信。Computing device 100 may also include interface bus 140 to facilitate communication from various interface devices (eg, output devices 142 , peripheral interfaces 144 , and communication devices 146 ) to base configuration 102 via bus/interface controller 130 . Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150 . They may be configured to facilitate communication with various external devices such as a display or speakers via one or more A/V ports 152 . Example peripherals interfaces 144 may include serial interface controller 154 and parallel interface controller 156, which may be configured to facilitate communication via one or more I/O ports 158 and input devices such as (e.g., keyboard, mouse, pen) , voice input device, touch input device) or other peripherals (such as printers, scanners, etc.) to communicate with external devices. The example communication device 146 may include a network controller 160 , which may be arranged to facilitate communication with one or more other computing devices 162 over a network communication link via one or more communication ports 164 .

网络通信链路可以是通信介质的一个示例。通信介质通常可以体现为在诸如载波或者其他传输机制之类的调制数据信号中的计算机可读指令、数据结构、程序模块,并且可以包括任何信息递送介质。“调制数据信号”可以这样的信号,它的数据集中的一个或者多个或者它的改变可以在信号中编码信息的方式进行。作为非限制性的示例,通信介质可以包括诸如有线网络或者专线网络之类的有线介质,以及诸如声音、射频(RF)、微波、红外(IR)或者其它无线介质在内的各种无线介质。这里使用的术语计算机可读介质可以包括存储介质和通信介质二者。在根据本发明的计算设备100中,应用122包括用于执行本发明的电路实验器件连接关系的识别方法200的指令。A network communication link may be one example of a communication medium. Communication media typically embodies computer readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism and may include any information delivery media. A "modulated data signal" may be a signal that has one or more of its data sets or changes thereof in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or a dedicated-line network, and various wireless media such as acoustic, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media. In the computing device 100 according to the present invention, the application 122 includes instructions for executing the method 200 for identifying the connection relationship of circuit experimental devices of the present invention.

智能实验测评系统通过判断导线和实验器件的连接状态来判断电路是否连接正确,但在实际测评过程中,由于导线连接交叉、摆放无序等问题,利用深度学习算法很难准确地识别实验器件之间的串并联连接状态。因此本方案提供一种电学实验器件连接关系的识别方法,能够对电路实验器件之间的串并联状态进行准确识别。The intelligent experimental evaluation system judges whether the circuit is connected correctly by judging the connection status of the wire and the experimental device. However, in the actual evaluation process, it is difficult to accurately identify the experimental device using the deep learning algorithm due to problems such as crossed wire connections and disorderly placement. between series and parallel connections. Therefore, this solution provides a method for identifying the connection relationship of electrical experimental devices, which can accurately identify the series-parallel connection state between the circuit experimental devices.

图2示出了根据本发明一个实施例的电路实验器件连接关系的识别方法200的流程示意图。如图2所示,该方法始于步骤S210,获取电路实验图片。FIG. 2 shows a schematic flowchart of a method 200 for identifying connection relationships of circuit experiment devices according to an embodiment of the present invention. As shown in FIG. 2 , the method starts at step S210 , obtaining a picture of a circuit experiment.

根据本发明的一个实施例,可以在实验操作台上方搭建摄像头,使摄像头能够俯视拍摄实验操作桌面,保证连接的整个电路图能够全部呈现在摄像头拍摄画面中。According to an embodiment of the present invention, a camera can be set up above the experimental operation table, so that the camera can overlook and shoot the experimental operation table top, and ensure that the entire circuit diagram connected can be fully presented in the image captured by the camera.

在获得摄像头采集的电路实验图片后,可以对图片进行筛选,将拍摄模糊、光线不足、抖动等不符合识别条件的图片去除,选择画面清晰的电路实验图片作为后续的待识别图片。After obtaining the circuit experiment pictures collected by the camera, the pictures can be screened, and the pictures that do not meet the recognition conditions such as blurred shooting, insufficient light, and jittering can be removed, and the circuit experiment pictures with clear pictures can be selected as subsequent pictures to be recognized.

图3示出了根据本发明一个实施例的电路实验图片示意图。如图3所示,电路实验图片中包含电压表、电流表、小灯泡、滑动变阻器、电池、开关以及用于连接各个器件的导线。Fig. 3 shows a schematic diagram of a picture of a circuit experiment according to an embodiment of the present invention. As shown in Figure 3, the circuit experiment picture includes a voltmeter, an ammeter, a small light bulb, a sliding rheostat, a battery, a switch, and wires used to connect various devices.

随后执行步骤S220,对电路实验图片进行目标检测,得到包含实验器件、已连接接线柱和已连接导线的识别结果。Then step S220 is executed to perform object detection on the circuit experiment picture to obtain a recognition result including the experimental device, the connected terminal and the connected wire.

可以分别对电路实验图片进行目标检测和实例分割,然后将目标检测结果和实例分割识别结果相叠加,用于后续有向图的构建。Target detection and instance segmentation can be performed on the circuit experiment pictures respectively, and then the target detection results and instance segmentation recognition results are superimposed for the construction of subsequent directed graphs.

根据本发明的一个实施例,可以将获取的电路实验图片输入预先训练好的第一目标检测模型中,得到电路实验器件的识别结果。例如,可以先对电路实验图片中的电源、开关、滑动变阻器、灯泡底座、电压表、电流表作为待识别目标进行检测,得到电源、开关、滑动变阻器、灯泡底座、电压表和电流表的检测框。According to an embodiment of the present invention, the obtained circuit test pictures can be input into the pre-trained first target detection model to obtain the recognition result of the circuit test device. For example, the power supply, switch, sliding rheostat, bulb base, voltmeter, and ammeter in the circuit experiment picture can be detected as targets to be identified, and the detection frames of the power supply, switch, sliding rheostat, bulb base, voltmeter, and ammeter can be obtained.

然后,继续将包含各电路实验器件检测框的电路实验图片输入预先训练好的第二目标检测模型中,输出得到已连接接线柱的检测框。例如,可以将接线柱作为第二目标检测模型的待识别目标进行检测,得到已连接接线柱的检测框。Then, continue to input the circuit test picture including the detection frame of each circuit test device into the pre-trained second target detection model, and output the detection frame connected to the terminal. For example, the terminal can be detected as the target to be recognized in the second target detection model, and the detection frame of the connected terminal can be obtained.

其中,第一目标检测模型和第二目标检测模型可以是Faster-RCNN、YOLO系列、SSD、Cornernet中任意一种。以YOLOv5模型为例,可以将所有实验器件的接线点统一识别为接线柱,根据接线柱和实验器件的空间位置关系,判断属于哪个实验器件的接线柱,判断接线柱是否与导线连接,如果与导线连接则将此接线柱识别为已连接接线柱,最终得到每个已连接接线柱的标注框。Wherein, the first target detection model and the second target detection model can be any one of Faster-RCNN, YOLO series, SSD, and Cornernet. Taking the YOLOv5 model as an example, the wiring points of all experimental devices can be uniformly identified as binding posts. According to the spatial position relationship between the binding post and the experimental device, it can be judged which connecting post belongs to the experimental device, and whether the connecting post is connected to the wire. The wire connection then identifies this terminal as a connected terminal, resulting in a callout box for each connected terminal.

需要说明的是,为了得到训练好的第一目标检测模型和第二目标检测模型,可以采用图像标注工具对实验器件、实验器件接线柱进行标注,标注内容包括名称、接线柱的颜色(红色表示正极,黑色表示负极,无正负极则用蓝色表示)和标注框坐标,作为训练数据集。利用YOLOv5模型对训练数据集进行训练和验证,得到训练好的第一目标检测模型和第二目标检测模型。It should be noted that, in order to obtain the trained first target detection model and the second target detection model, an image annotation tool can be used to mark the experimental device and the terminal of the experimental device. The content of the label includes the name and the color of the terminal (red means Positive pole, black for negative pole, blue for no positive and negative pole) and coordinates of the labeled frame, as the training data set. The YOLOv5 model is used to train and verify the training data set, and the trained first target detection model and the second target detection model are obtained.

图4示出了根据本发明一个实施例的电路实验器件识别结果示意图。如图4所示,第一目标检测模型输出的识别结果中包含电压表的类别标注和检测框、电流表的类别标注和检测框、滑动变阻器的类别标注和检测框、开关的标注和检测框、电源的类别标注和检测框、灯泡底座的类别标注和检测框。Fig. 4 shows a schematic diagram of device identification results of a circuit experiment according to an embodiment of the present invention. As shown in Figure 4, the recognition results output by the first target detection model include the category label and detection frame of the voltmeter, the category label and detection frame of the ammeter, the category label and detection frame of the sliding rheostat, the label and detection frame of the switch, The category label and check box of the power supply, the category label and check box of the bulb base.

图5示出了根据本发明一个实施例的接线柱的识别结果示意图。如图5所示,第二目标检测模型输出的识别结果中包含已连接红色接线柱的标注和检测框、已连接黑色接线柱的标注和检测框、已连接接线柱标注和检测框。其中已连接接线柱表示的是无法识别颜色的接线柱和滑动变阻器上的已连接接线柱。Fig. 5 shows a schematic diagram of a recognition result of a terminal according to an embodiment of the present invention. As shown in Figure 5, the recognition results output by the second target detection model include the label and detection frame of the connected red terminal, the label and detection frame of the connected black terminal, and the label and detection frame of the connected terminal. Wherein the connected terminal refers to the terminal of unidentifiable color and the connected terminal on the sliding rheostat.

在电路实验器件较多的复杂场景下,可以用不同的颜色标注不同种类的实验器件或已连接接线柱。例如,使用红色标注电压表,使用蓝色标注电流表等,使用黄色标注已连接接线柱,使用紫色标注已连接红色接线柱。In complex scenarios with many circuit experimental devices, different types of experimental devices or connected terminals can be marked with different colors. For example, use red for voltmeters, blue for ammeters, etc., yellow for connected terminals, and purple for connected red terminals.

对于导线这样细长条形状的目标物体,为了提高识别的准确性,可以将包含电路实验器件检测框和已连接接线柱检测框的电路实验图片输入预先训练好的实例分割模型中,得到已连接导线识别结果。For a target object in the shape of a thin strip such as a wire, in order to improve the accuracy of recognition, the circuit experiment picture including the detection frame of the circuit experiment device and the detection frame of the connected terminal can be input into the pre-trained instance segmentation model to obtain the connected Wire identification results.

实例分割模型可以是mask RCNN,首先基于模型的基础网络backbone获得不同尺度的特征图,然后基于区域建议网络RPN在特征图上每个点生成不同尺度的矩形框,并通过网络进行粗分类和粗定位,基于置信度和非极大值抑制筛除大量的矩形框,将剩余矩形框输入后续网络。随后将不同大小和尺度的矩形框通过ROI Align层输出固定尺寸的特征图。最后将固定大小的特征图作为分类分支、坐标回归分支和Mask分支的输入,进一步判断矩形框是什么类别,判断矩形框内哪些像素是物体,哪些像素是背景,从而通过实例分割获得导线的二值化掩膜图像。The instance segmentation model can be mask RCNN. First, feature maps of different scales are obtained based on the model's basic network backbone, and then based on the region proposal network RPN, each point on the feature map generates rectangular frames of different scales, and rough classification and rough classification are performed through the network. Positioning, based on confidence and non-maximum value suppression, a large number of rectangular boxes are screened out, and the remaining rectangular boxes are input into the subsequent network. Then the rectangular frames of different sizes and scales are output through the ROI Align layer to output a fixed-size feature map. Finally, the fixed-size feature map is used as the input of the classification branch, coordinate regression branch and Mask branch to further determine the category of the rectangular frame, determine which pixels in the rectangular frame are objects, and which pixels are the background, so as to obtain the second dimension of the wire through instance segmentation. Valued mask image.

实例分割模型还可以是HTC模型、cascade maskRCNN模型等,本方案对此不做限定。The instance segmentation model can also be an HTC model, a cascade maskRCNN model, etc., which is not limited in this solution.

图6示出了根据本发明一个实施例的已连接导线识别结果示意图。如图6所示,电路实验图片中的每一个导线都被标注出。还可以基于均值滤波迁移、边缘检测等图像处理方法对图片中的导线进行识别。然后根据导线与实验器件和已连接接线柱的位置关系,确定已连接导线。Fig. 6 shows a schematic diagram of an identification result of connected wires according to an embodiment of the present invention. As shown in Figure 6, each wire in the circuit experiment picture is marked. It can also identify the wires in the picture based on image processing methods such as mean filter migration and edge detection. Then determine the connected wire according to the positional relationship between the wire and the experimental device and the connected terminal.

将上述目标识别结果和实例分割结果进行叠加之后,就可以执行步骤S230,根据目标识别结果和实例分割结果构建电路实验对应的有向图。After the above target recognition result and instance segmentation result are superimposed, step S230 can be performed to construct a directed graph corresponding to the circuit experiment according to the target recognition result and the instance segmentation result.

根据本发明的一个实施例,先根据识别的已连接接线柱与已连接导线实例确定导线中的电流方向,即导线从“已连接黑色接线柱”到“已连接红色接线柱”的方向为电流方向、“已连接黑色接线柱”到“已连接接线柱”的方向为电流方向、“已连接接线柱”到“已连接红色接线柱”的方向为电流方向。According to one embodiment of the present invention, first determine the current direction in the wire according to the identified connected terminal and the connected wire instance, that is, the direction of the wire from "connected black terminal" to "connected red terminal" is the current direction. Direction, the direction from "connected black terminal" to "connected terminal" is the direction of current, and the direction from "connected terminal" to "connected red terminal" is the direction of current.

例如,小灯泡底座上的已连接接线柱到电流表的已连接红色接线柱的方向为电流流动方向。整个动态有向图构建可以将电流方向作为图数据中边的方向(电源—>开关、开关—>滑动变阻器、滑动变阻器—>小灯泡底座,小灯泡底座—>电流表、电流表—>电源),电路实验器件作为图顶点。对于导线两端同时都为“已连接黑色接线柱”或“已连接红色接线柱”(无法确定电流方向)的情况可以先不考虑,自动生成初始有向图。For example, the direction from the connected post on the base of the small light bulb to the connected red post on the ammeter is the direction of current flow. The entire dynamic directed graph construction can take the direction of current as the direction of the edges in the graph data (power supply—>switch, switch—>sliding rheostat, sliding rheostat—>small light bulb base, small light bulb base—>ammeter, ammeter—>power supply), Circuit experimental devices are used as graph vertices. For the case where both ends of the wire are "connected to the black terminal" or "connected to the red terminal" (the direction of the current cannot be determined), the initial directed graph can be automatically generated.

图7示出了根据本发明一个实施例的电路实验的初始有向图示意图。如图7所示,电压表、电流表、小灯泡底座、滑动变阻器、电源和开关作为有向图的顶点,电压表到电流表的电流方向、小灯泡底座到电流表的电流方向、滑动变阻器到小灯泡底座的电流方向、开关到滑动变阻器的电流方向、电源到开关的电流方向和电流表到电源的电流方向作为有向图的边。Fig. 7 shows a schematic diagram of an initial directed graph of a circuit experiment according to an embodiment of the present invention. As shown in Figure 7, the voltmeter, ammeter, small light bulb base, sliding rheostat, power supply and switch are the vertices of the directed graph, the current direction from the voltmeter to the ammeter, the current direction from the small light bulb base to the ammeter, and the sliding rheostat to the small light bulb The current direction of the base, the current direction of the switch to the sliding rheostat, the current direction of the power supply to the switch, and the current direction of the ammeter to the power supply are used as the edges of the directed graph.

对于导线两端同时都是已连接红色接线柱的情况,根据图7所示的初始有向图进行逆向查询,即小灯泡底座的上个设备,即滑动变阻器,从而滑动变阻器到电压表增加一条有向边。同理,若导线两端同时都是已连接黑色接线柱,则根据图7所示的初始有向图查询对应设备的下一个设备。若导线两端同时是无法识别颜色的已连接接线柱,则设备两端之间增加双向边。For the case where both ends of the wire are connected to the red terminal at the same time, perform a reverse query according to the initial directed graph shown in Figure 7, that is, the last device at the base of the small light bulb, that is, the sliding rheostat, so that the sliding rheostat adds a line to the voltmeter There is an edge. Similarly, if both ends of the wire are connected to black terminals at the same time, the next device of the corresponding device is queried according to the initial directed graph shown in FIG. 7 . If both ends of the wire are connected terminals of an unidentifiable color at the same time, a bidirectional edge is added between the two ends of the device.

图8示出了根据本发明一个实施例的电路实验对应的有向图示意图。如图8所示,与图7建立的初始有向图相比,最终建立的有向图中增加了滑动变阻器到电压表的有向边。Fig. 8 shows a schematic diagram of a directed graph corresponding to a circuit experiment according to an embodiment of the present invention. As shown in Figure 8, compared with the initial directed graph established in Figure 7, the finally established directed graph adds the sliding rheostat to the directed edge of the voltmeter.

最后执行步骤S240,基于有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。Finally, step S240 is executed, based on the directed path of each experimental device in the directed graph, the series-parallel connection relationship between the circuit experimental devices is judged.

具体地,可以对于有向图中每个实验器件进行路径查询,即,以某个实验器件为起点查询连接路径,直到查询路径回到该实验器件;Specifically, the path query can be performed for each experimental device in the directed graph, that is, the connection path is queried from a certain experimental device until the query path returns to the experimental device;

若第一实验器件的查询路径中不包含第二实验器件,则确定第一实验器件与第二实验器件之间为并联关系;若第一实验器件的查询路径中包含第二实验器件,则确定第一实验器件与第二实验器件之间为串联关系。If the query path of the first experimental device does not include the second experimental device, it is determined that the first experimental device and the second experimental device are in parallel relationship; if the query path of the first experimental device contains the second experimental device, then determine There is a series relationship between the first experimental device and the second experimental device.

在本发明的一个实施例中,可以分别对电压表、小灯泡底座所在的图节点进行有向边的路径查询,直到回到指定查询设备,若彼此路径中存在对方设备,则表示两个设备为串联关系,若彼此路径中不存在对方设备,则表示查询的两个设备之间为并联关系。In one embodiment of the present invention, the directed edge path query can be performed on the graph nodes where the voltmeter and the small light bulb base are located, until the specified query device is returned. If there is an opposite device in each other's path, it means two devices It is a series relationship. If there is no other device in the path of each other, it means that the two devices queried are in a parallel relationship.

例如,对电压表进行有向路径查询:电压表—>电流表—>电源—>开关—>滑动变阻器—电压表。对小灯泡底座进行有向路径查询:小灯泡底座—>电流表—>电源—>开关—>滑动变阻器—>小灯泡底座。可见,电压表的有向路径中没有小灯泡底座,小灯泡底座的有向路径中没有电压表,表明小灯泡底座和电压表之间为并联关系。For example, perform a directed path query on a voltmeter: voltmeter—>ammeter—>power supply—>switch—>sliding rheostat—voltmeter. Perform directed path query on the small light bulb base: small light bulb base—>ammeter—>power supply—>switch—>sliding rheostat—>small light bulb base. It can be seen that there is no small light bulb base in the directed path of the voltmeter, and there is no voltmeter in the directed path of the small light bulb base, indicating that there is a parallel connection between the small light bulb base and the voltmeter.

依照上述方法对每两个电路实验器件之间的连接关系进行判断,最后得到整个电路中各个电路实验器件之间的串并联连接关系。According to the above method, the connection relationship between every two circuit experimental devices is judged, and finally the series-parallel connection relationship between each circuit experimental device in the whole circuit is obtained.

图9示出了根据本发明一个实施例的电路实验器件连接关系的识别装置900的结构示意图。如图9所示,该装置900可以包括:获取模块910、检测模块920、构建模块930和判断模块940。FIG. 9 shows a schematic structural diagram of an apparatus 900 for identifying connection relationships of circuit experiment devices according to an embodiment of the present invention. As shown in FIG. 9 , the apparatus 900 may include: an acquisition module 910 , a detection module 920 , a construction module 930 and a judgment module 940 .

其中,获取模块910可以获取电路实验图片。可以通过实验操作台上方的摄像头采集电路实验图片,并对采集的图片进行筛选或者预处理,得到能够满足目标检测模型识别条件的待识别电路实验图片。Wherein, the acquiring module 910 can acquire the circuit experiment pictures. The circuit experiment pictures can be collected through the camera above the experiment console, and the collected pictures can be screened or preprocessed to obtain the circuit experiment pictures to be recognized that can meet the recognition conditions of the target detection model.

检测模块920可以对获取模块910获取的电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果。The detection module 920 can perform object detection and instance segmentation on the circuit experiment pictures acquired by the acquisition module 910, and obtain object recognition results including circuit experiment devices, connected terminals, and instance segmentation results of connected wires.

根据本发明的一个实施例,可以采用pytorch库构建YOLOv5网络和mask RCNN网络,先将电路实验图片输入预先训练好的第一YOLOv5网络中,得到电路实验器件检测框;再将包含电路实验器件检测框的电路实验图片输入预先训练好的第二YOLOv5网络中,得到已连接接线柱检测框;以及将电路实验图片输入预先训练好的mask RCNN网络中,得到已连接导线识别结果。According to an embodiment of the present invention, the YOLOv5 network and mask RCNN network can be constructed by using the pytorch library, and the circuit experiment picture is first input into the pre-trained first YOLOv5 network to obtain the detection frame of the circuit experiment device; Input the circuit experiment picture of the frame into the pre-trained second YOLOv5 network to obtain the connected terminal detection frame; and input the circuit experiment picture into the pre-trained mask RCNN network to obtain the connected wire recognition result.

构建模块930可以根据检测模块920得到的目标识别结果和实例分割结果构建有向图。例如,将电路实验器件作为有向图的顶点;根据接线柱和已连接导线确定导线中的电流方向,作为有向图的边。The construction module 930 may construct a directed graph according to the object recognition result and the instance segmentation result obtained by the detection module 920 . For example, take the circuit experimental device as the vertex of the directed graph; determine the direction of the current in the wire according to the terminal and the connected wire as the edge of the directed graph.

可以先将导线从已连接黑色接线柱到已连接红色接线柱的方向确定为电流方向;将导线从已连接黑色接线柱到已连接接线柱的方向确定为电流方向;将导线从已连接接线柱到已连接红色接线柱的方向确定为电流方向,生成初始有向图。You can first determine the direction of the wire from the connected black terminal to the connected red terminal as the current direction; determine the direction of the wire from the connected black terminal to the connected terminal as the current direction; The direction to the connected red terminal is determined as the current direction, generating an initial directed graph.

然后,对初始有向图进行修正,即,如果导线两端都是已连接红色接线柱,则对初始有向图进行逆向查询;如果导线两端都是已连接黑色接线柱,则对初始有向图进行正向查询;如果导线两端都是已连接接线柱,则在电路实验器件之间增加一条双向边。最终得到整个电路实验图对应的有向图。Then, the initial directed graph is corrected, that is, if both ends of the wire are connected to red terminals, reverse query is performed on the initial directed graph; if both ends of the wire are connected to black terminals, then the initial directed graph is Make a forward query to the graph; if both ends of the wire are connected terminals, add a bidirectional edge between the circuit experiment devices. Finally, the directed graph corresponding to the whole circuit experiment graph is obtained.

判断模块940可以基于构建模块930得到的有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。The judging module 940 can judge the series-parallel connection relationship between the circuit experimental devices based on the directed path of each experimental device in the directed graph obtained by the construction module 930 .

具体地,对于有向图中每个实验器件进行路径查询,直到查询路径回到实验器件;若第一实验器件的查询路径中不包含第二实验器件,则确定第一实验器件与第二实验器件之间为并联关系;若第一实验器件的查询路径中包含第二实验器件,则确定第一实验器件与第二实验器件之间为串联关系。Specifically, path query is performed for each experimental device in the directed graph until the query path returns to the experimental device; if the query path of the first experimental device does not include the second experimental device, then determine the first experimental device and the second experimental device The devices are in a parallel relationship; if the query path of the first experimental device includes the second experimental device, it is determined that the first experimental device and the second experimental device are in a serial relationship.

通过上述方案,通过对电路实验图片进行更加细粒度的目标检测和实例分割,能够降低特征提取难度,有利于提高识别准确性;根据识别结果构建有向图,能够更加形象地表达电学实验中电路图连接关系的描述,相比于直接利用深度学习模型进行连接关系的识别,本方案能够提高电学设备之间连接关系识别的准确性,能够适用于复杂场景下的电路实验器件连接关系的准确识别。Through the above scheme, by performing more fine-grained target detection and instance segmentation on the circuit experiment pictures, the difficulty of feature extraction can be reduced, which is conducive to improving the recognition accuracy; constructing a directed graph based on the recognition results can more vividly express the circuit diagram in the electrical experiment For the description of the connection relationship, compared with directly using the deep learning model to identify the connection relationship, this scheme can improve the accuracy of the connection relationship identification between electrical equipment, and can be applied to the accurate identification of the connection relationship of circuit experiment devices in complex scenarios.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员应当理解在本文所公开的示例中的设备的模块或单元或组件可以布置在如该实施例中所描述的设备中,或者可替换地可以定位在与该示例中的设备不同的一个或多个设备中。前述示例中的模块可以组合为一个模块或者此外可以分成多个子模块。Those skilled in the art will understand that the modules or units or components of the devices in the examples disclosed herein may be arranged in the device as described in this embodiment, or alternatively may be located in a different location than the device in this example. in one or more devices. The modules in the preceding examples may be combined into one module or furthermore may be divided into a plurality of sub-modules.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

此外,所述实施例中的一些在此被描述成可以由计算机系统的处理器或者由执行所述功能的其它装置实施的方法或方法元素的组合。因此,具有用于实施所述方法或方法元素的必要指令的处理器形成用于实施该方法或方法元素的装置。此外,装置实施例的在此所述的元素是如下装置的例子:该装置用于实施由为了实施该发明的目的的元素所执行的功能。Furthermore, some of the described embodiments are described herein as a method or combination of method elements that may be implemented by a processor of a computer system or by other means for performing the described function. Thus, a processor with the necessary instructions for carrying out the described method or element of a method forms a means for carrying out the method or element of a method. Furthermore, elements described herein of an apparatus embodiment are examples of means for carrying out the function performed by the element for the purpose of carrying out the invention.

如在此所使用的那样,除非另行规定,使用序数词“第一”、“第二”、“第三”等等来描述普通对象仅仅表示涉及类似对象的不同实例,并且并不意图暗示这样被描述的对象必须具有时间上、空间上、排序方面或者以任意其它方式的给定顺序。As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe generic objects merely means referring to different instances of similar objects and is not intended to imply such The described objects must have a given order temporally, spatially, sequentially or in any other way.

尽管根据有限数量的实施例描述了本发明,但是受益于上面的描述,本技术领域内的技术人员明白,在由此描述的本发明的范围内,可以设想其它实施例。此外,应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的而非限制性的,本发明的范围由所附权利要求书限定。While the invention has been described in terms of a limited number of embodiments, it will be apparent to a person skilled in the art having the benefit of the above description that other embodiments are conceivable within the scope of the invention thus described. In addition, it should be noted that the language used in the specification has been chosen primarily for the purpose of readability and instruction rather than to explain or define the inventive subject matter. Accordingly, many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative rather than restrictive with respect to the scope of the present invention, which is defined by the appended claims.

Claims (10)

1.一种电路实验器件连接关系的识别方法,其特征在于,包括:1. A method for identifying connection relationship of circuit experiment devices, characterized in that, comprising: 获取电路实验图片;Obtain the circuit experiment picture; 对所述电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果;Carrying out target detection and instance segmentation on the circuit experiment picture, and obtaining the object recognition result including the circuit experiment device, the connected terminal and the instance segmentation result of the connected wire; 根据所述目标识别结果和实例分割结果构建电路实验对应的有向图;以及Constructing a directed graph corresponding to the circuit experiment according to the target recognition result and the instance segmentation result; and 基于所述有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。Based on the directed path of each experimental device in the directed graph, the series-parallel connection relationship between the circuit experimental devices is judged. 2.根据权利要求1所述的识别方法,其特征在于,所述对所述电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果的步骤包括:2. identification method according to claim 1, is characterized in that, described described circuit test picture is carried out target detection and instance segmentation, obtains the target recognition result that comprises circuit test device, connected binding post and connected lead. The steps for instance segmentation results include: 将所述电路实验图片输入预先训练好的第一目标检测模型中,得到电路实验器件检测框;Inputting the circuit experiment picture into the pre-trained first target detection model to obtain the circuit experiment device detection frame; 将包含所述电路实验器件检测框的电路实验图片输入预先训练好的第二目标检测模型中,得到已连接接线柱检测框;以及Inputting the circuit experiment picture containing the detection frame of the circuit experiment device into the pre-trained second target detection model to obtain the connected terminal detection frame; and 将包含所述电路实验器件检测框和已连接接线柱检测框的电路实验图片输入预先训练好的实例分割模型中,得到已连接导线识别结果。Inputting the circuit experiment picture containing the detection frame of the circuit experiment device and the detection frame of the connected terminal into the pre-trained instance segmentation model to obtain the recognition result of the connected wire. 3.根据权利要求2所述的识别方法,其特征在于,所述第一目标检测模型和第二目标检测模型为Faster-RCNN、YOLO、SSD、Cornernet中任意一种,所述实例分割模型为mask RCNN、cascade RCNN中任意一种。3. The recognition method according to claim 2, wherein the first target detection model and the second target detection model are any one of Faster-RCNN, YOLO, SSD, and Cornernet, and the instance segmentation model is Any one of mask RCNN and cascade RCNN. 4.根据权利要求1所述的识别方法,其特征在于,所述根据所述目标识别结果和实例分割结果构建电路实验对应的有向图的步骤包括:4. The identification method according to claim 1, wherein the step of constructing a directed graph corresponding to a circuit experiment according to the target identification result and the instance segmentation result comprises: 将电路实验器件作为有向图的顶点;Take the circuit experimental device as the vertex of the directed graph; 根据接线柱和已连接导线确定导线中的电流方向,作为有向图的边。Determines the direction of current flow in wires based on the terminals and connected wires as edges of a directed graph. 5.根据权利要求4所述的识别方法,其特征在于,所述接线柱包括已连接红色接线柱、已连接黑色接线柱、已连接接线柱,所述根据接线柱和已连接导线确定导线中的电流方向的步骤包括:5. The identification method according to claim 4, characterized in that, the binding post includes a connected red binding post, a connected black binding post, and a connected binding post, and it is determined according to the binding post and the connected wire The current direction steps include: 将导线从已连接黑色接线柱到已连接红色接线柱的方向确定为电流方向;Determine the direction of the wire from the connected black terminal to the connected red terminal as the current direction; 将导线从已连接黑色接线柱到已连接接线柱的方向确定为电流方向;Determine the direction of the wire from the connected black terminal to the connected terminal as the current direction; 将导线从已连接接线柱到已连接红色接线柱的方向确定为电流方向,生成初始有向图。Determine the direction of the wire from the connected terminal to the connected red terminal as the direction of the current flow, generating an initial directed graph. 6.根据权利要求5所述的识别方法,其特征在于,所述根据接线柱和已连接导线确定导线中的电流方向的步骤还包括:6. The identification method according to claim 5, wherein the step of determining the direction of current in the wire according to the binding post and the connected wire further comprises: 如果导线两端都是已连接红色接线柱,则对所述初始有向图进行逆向查询;If both ends of the wire are connected to the red terminal, perform a reverse query on the initial directed graph; 如果导线两端都是已连接黑色接线柱,则对所述初始有向图进行正向查询;If both ends of the wire are connected to black terminals, perform a forward query on the initial directed graph; 如果导线两端都是已连接接线柱,则在电路实验器件之间增加一条双向边。If both ends of the wire are connected terminals, add a bidirectional edge between the circuit experiment devices. 7.根据权利要求1所述的识别方法,其特征在于,所述基于所述有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系的步骤包括:7. identification method according to claim 1, is characterized in that, described based on the directional path of each experimental device in described directed graph, the step of judging the series-parallel connection relationship between circuit experimental devices comprises: 对于有向图中每个实验器件进行路径查询,直到查询路径回到所述实验器件;Perform path query for each experimental device in the directed graph until the query path returns to the experimental device; 若第一实验器件的查询路径中不包含第二实验器件,则确定第一实验器件与第二实验器件之间为并联关系;If the query path of the first experimental device does not include the second experimental device, it is determined that the first experimental device and the second experimental device are in a parallel relationship; 若第一实验器件的查询路径中包含第二实验器件,则确定第一实验器件与第二实验器件之间为串联关系。If the query path of the first experimental device includes the second experimental device, it is determined that the relationship between the first experimental device and the second experimental device is in series. 8.一种电路实验器件连接关系的识别装置,其特征在于,包括:8. A device for identifying the connection relationship of circuit experiment devices, characterized in that it comprises: 获取模块,用于获取电路实验图片;The acquisition module is used to acquire circuit experiment pictures; 检测模块,用于对所述电路实验图片进行目标检测和实例分割,得到包含电路实验器件、已连接接线柱的目标识别结果和已连接导线的实例分割结果;The detection module is used to perform target detection and instance segmentation on the circuit experiment picture, and obtain the object recognition result including the circuit experiment device, the connected terminal and the instance segmentation result of the connected wire; 构建模块,用于根据所述目标识别结果和实例分割结果构建电路实验对应的有向图;以及A construction module, configured to construct a directed graph corresponding to a circuit experiment according to the target recognition result and the instance segmentation result; and 判断模块,用于基于所述有向图中各个实验器件的有向路径,判断电路实验器件之间的串并联连接关系。The judging module is configured to judge the series-parallel connection relationship between the circuit experimental devices based on the directed path of each experimental device in the directed graph. 9.一种计算设备,包括:9. A computing device comprising: 至少一个处理器;和存储有程序指令的存储器,其中,所述程序指令被配置为适于由所述至少一个处理器执行,所述程序指令包括用于执行如权利要求1-7中任一项所述的电路实验器件连接关系的识别方法的指令。at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing any one of claims 1-7 Instructions for the identification method of the circuit experiment device connection relationship described in the item. 10.一种存储有程序指令的可读存储介质,当所述程序指令被计算设备读取并执行时,使得所述计算设备执行如权利要求1-7中任一项所述的电路实验器件连接关系的识别方法。10. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device is made to execute the circuit experimental device according to any one of claims 1-7 The identification method of connection relationship.
CN202310229660.6A 2023-03-10 2023-03-10 Method and device for identifying connection relation of circuit experimental device Pending CN116503719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310229660.6A CN116503719A (en) 2023-03-10 2023-03-10 Method and device for identifying connection relation of circuit experimental device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310229660.6A CN116503719A (en) 2023-03-10 2023-03-10 Method and device for identifying connection relation of circuit experimental device

Publications (1)

Publication Number Publication Date
CN116503719A true CN116503719A (en) 2023-07-28

Family

ID=87327408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310229660.6A Pending CN116503719A (en) 2023-03-10 2023-03-10 Method and device for identifying connection relation of circuit experimental device

Country Status (1)

Country Link
CN (1) CN116503719A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118135294A (en) * 2024-02-26 2024-06-04 上海锡鼎实业有限公司 Method, system, device and medium for identifying circuit connection relationship

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833689A (en) * 2019-04-19 2020-10-27 杭州海康威视数字技术股份有限公司 A scoring method and device for electrical experiments
CN112256908A (en) * 2019-07-22 2021-01-22 深圳市创能亿科科技开发有限公司 Method and system for identifying device connection relation
CN112528845A (en) * 2020-12-11 2021-03-19 华中师范大学 Physical circuit diagram identification method based on deep learning and application thereof
CN114677586A (en) * 2022-03-15 2022-06-28 南京邮电大学 An automatic identification method of physical circuit experiment
CN114708486A (en) * 2022-04-07 2022-07-05 太原智林信息技术股份有限公司 Automatic judging method for physical and electrical experiment operation circuit connection
CN114743028A (en) * 2022-03-31 2022-07-12 上海锡鼎智能科技有限公司 Wire identification method and device, computing equipment and storage medium
CN114913748A (en) * 2022-06-01 2022-08-16 中国矿业大学 Electrician experiment device with intelligent experiment line detection function and detection method thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833689A (en) * 2019-04-19 2020-10-27 杭州海康威视数字技术股份有限公司 A scoring method and device for electrical experiments
CN112256908A (en) * 2019-07-22 2021-01-22 深圳市创能亿科科技开发有限公司 Method and system for identifying device connection relation
CN112528845A (en) * 2020-12-11 2021-03-19 华中师范大学 Physical circuit diagram identification method based on deep learning and application thereof
CN114677586A (en) * 2022-03-15 2022-06-28 南京邮电大学 An automatic identification method of physical circuit experiment
CN114743028A (en) * 2022-03-31 2022-07-12 上海锡鼎智能科技有限公司 Wire identification method and device, computing equipment and storage medium
CN114708486A (en) * 2022-04-07 2022-07-05 太原智林信息技术股份有限公司 Automatic judging method for physical and electrical experiment operation circuit connection
CN114913748A (en) * 2022-06-01 2022-08-16 中国矿业大学 Electrician experiment device with intelligent experiment line detection function and detection method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118135294A (en) * 2024-02-26 2024-06-04 上海锡鼎实业有限公司 Method, system, device and medium for identifying circuit connection relationship

Similar Documents

Publication Publication Date Title
CN110659646A (en) Automatic multitask certificate image processing method, device, equipment and readable storage medium
CN105184778B (en) Detection method and device
CN107392125A (en) Training method/system, computer-readable recording medium and the terminal of model of mind
CN112528908B (en) Living body detection method, living body detection device, electronic equipment and storage medium
CN112381092B (en) Tracking method, device and computer readable storage medium
CN111144493B (en) Method for automatically identifying algorithm index test, storage medium and electronic terminal
CN109657675B (en) Image annotation method and device, computer equipment and readable storage medium
CN111353580B (en) Training method, electronic equipment and storage medium for target detection network
JP2014063494A (en) Classification device, classification method, and electronic facility
CN109408367A (en) A kind of method and terminal of the control element identifying interactive interface
CN113780116B (en) Invoice classification method, device, computer equipment and storage medium
CN112861867A (en) Pointer type instrument panel identification method, system and storage medium
CN115424111A (en) Intelligent identification method, device, equipment and medium of antigen detection kit
WO2022002262A1 (en) Character sequence recognition method and apparatus based on computer vision, and device and medium
CN110287831A (en) Method, device and electronic equipment for acquiring control points based on landmarks
CN114708582B (en) AI and RPA-based electric power data intelligent inspection method and device
CN109784339A (en) Picture recognition test method, device, computer equipment and storage medium
CN111144466A (en) A deep metric learning method for image sample adaptation
CN114782769B (en) Training sample generation method, device, system and target object detection method
CN116503719A (en) Method and device for identifying connection relation of circuit experimental device
CN113536868B (en) Circuit board fault identification method and related equipment
CN111914863B (en) Target detection method, device, terminal equipment and computer readable storage medium
CN113050022B (en) An image positioning method, device and terminal equipment based on rotating antenna
CN112464753B (en) Method and device for detecting key points in image and terminal equipment
CN116363076A (en) Method and device for judging current flow direction of experimental circuit

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