A wire detection method and device for experimental operations
By generating and judging feature vectors for wire plugs, the problems of large wire recognition error and high noise in the prior art are solved, and higher detection accuracy and efficiency are achieved, providing support for the automated scoring of physical electrical experiments.
Patent Information
- Application Number
- CN202210503115.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-05-09
AI Technical Summary
In the prior art, when identifying wires in an image using an object detection algorithm, there are problems of large errors and high noises. Especially when the wires are slender and have unfixed shapes, it is difficult to accurately detect the connection of the wires.
By acquiring the image to be detected, the wire plug is detected, the plug feature vector is generated, and the wire plug corresponding to the same wire is judged based on these feature vectors to generate the wire detection result. This method improves the accuracy and efficiency of detection by judging the uniqueness of the scale of the wire plug.
It reduces the error of wire detection, reduces detection noise, improves the accuracy of wire connection, and provides a basis for the automated scoring of physical and electrical experiments.
Smart Images

Figure CN114882257B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wire detection, and particularly relates to a wire detection method and device for experimental operations. Background Art
[0002] Physical experiments can cultivate students' operation ability and innovation ability. The current scoring methods for physical electricity experiments are all subjectively scored by teachers according to certain key operation steps and scoring points, and a large number of professional subject teachers are required to score one by one. The workload of teachers is huge. During the experimental process, subject teachers need to confirm the key steps and scoring points. Since there are certain differences in the scoring criteria for the same test point among different teachers, it is very difficult to achieve complete unity of the scoring criteria. Therefore, it is of great significance to realize the automatic scoring of physical electricity experiments.
[0003] Judging whether the student's operation steps are correct and whether the electrical instruments are correctly connected is an important scoring point for physical electricity experiment operations. Therefore, how to judge whether the student's operation steps are correct and whether the electrical instruments are correctly connected to accurately detect the wires is crucial.
[0004] Since the wire is relatively slender and has a large span in the image, the wire can be bent arbitrarily and its shape is not fixed, which will cause problems such as large errors in the recognition of the wire by the target detection algorithm. The recognized target detection box may contain multiple wires, which poses certain difficulties for subsequent judgment of what equipment the wire is connected to. Traditional image processing methods, such as edge detection and the method of identifying wires by color, need to filter out a lot of noise with the same color as the wire, and there are wire crossings during the experimental operation. How to distinguish different wires is also not ideal. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the defects of large recognition errors and large noise of the wires in the image by using the target detection algorithm in the prior art, so as to provide a wire detection method and device for experimental operations.
[0006] An embodiment of the present invention provides a wire detection method for experimental operations, including the following steps:
[0007] Obtain an image to be detected, detect the wire plugs in the image to be detected, and generate plug feature vectors;
[0008] Based on the plug feature vectors, judge the wire plugs corresponding to the same wire to generate a wire detection result.
[0009] Due to the characteristics of large wire span and unfixed shape, the wire plugs of the wire are detected, and whether the plugs belong to the same wire is judged through the plug feature vector. The scale of the wire plug is unique, with high accuracy, reducing the detection error of the wire and minimizing the detection noise.
[0010] Optionally, the step of inputting the image to be detected into the target detection model to generate a plug feature vector includes:
[0011] Inputting the image to be detected into the target detection model to generate the image coordinate position of the wire plug;
[0012] Inputting the image to be detected into the feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position;
[0013] Matching the image coordinate position of the wire plug with the image feature map to generate a plug feature vector.
[0014] In the present invention, the image to be detected is input into the target detection model to generate the image coordinate position of the wire plug, improving the detection efficiency and accuracy of the wire plug, and using the feature extraction model to extract features from the image to be detected to generate the image feature map corresponding to the image to be detected, laying a foundation for the subsequent matching of the image coordinate position of the wire plug and the image feature map.
[0015] Optionally, the step of inputting the image to be detected into the feature extraction model to generate the image feature map includes:
[0016] Adjusting the size of the image to be detected based on a preset image size;
[0017] Inputting the image to be detected with the adjusted size into the feature extraction model to generate the image feature map.
[0018] In the present invention, by adjusting the size of the image to be detected, the size of the image to be detected is made equal to that of the image feature map, laying a foundation for the subsequent matching of the image coordinate position of the wire plug and the image feature map.
[0019] Optionally, the step of matching the image coordinate position of the wire plug with the image feature map to generate a plug feature vector includes:
[0020] Retrieving the feature vector length feature based on the image coordinate position of the wire plug as the plug feature vector.
[0021] In the present invention, based on the image coordinate position of the wire plug, the feature vector length feature corresponding to the image coordinate position of the wire plug is retrieved from the feature map, improving the extraction accuracy of the corresponding feature vector of the wire plug.
[0022] Optionally, determining the wire plugs corresponding to the same wire based on the plug feature vectors and generating a wire detection result includes:
[0023] Determining the similarity between multiple wire plugs based on multiple plug feature vectors;
[0024] Sorting multiple similarities and judging two wire plugs corresponding to the same wire based on the sorting result to generate the wire detection result.
[0025] The present invention judges whether the connection between the wire plug and the wire is correct by the similarity between wire plugs, reduces the detection error of the wire, and provides a basis for the automatic scoring of physical electrical experiments.
[0026] Optionally, determining the similarity between multiple wire plugs based on multiple plug feature vectors includes:
[0027] Calculating the similarity between multiple wire plugs based on multiple plug feature vectors by using the Euclidean distance algorithm.
[0028] Optionally, judging two wire plugs corresponding to the same wire based on the sorting result to generate the wire detection result includes:
[0029] Selecting two wire plugs corresponding to the minimum similarity to obtain that the two wire plugs are connected to the same wire.
[0030] In the second aspect of the present application, a wire detection device for experimental operations is further proposed, including:
[0031] A detection module for acquiring a to-be-detected image, detecting wire plugs in the to-be-detected image, and generating plug feature vectors;
[0032] A judgment module for judging the wire plugs corresponding to the same wire based on the plug feature vectors and generating a wire detection result.
[0033] Optionally, the detection module includes:
[0034] A first generation sub-module for inputting the to-be-detected image into a target detection model to generate the image coordinate positions of wire plugs;
[0035] A second generation sub-module for inputting the to-be-detected image into a feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position;
[0036] A matching sub-module for matching the image coordinate positions of wire plugs with the image feature map to generate plug feature vectors.
[0037] Optionally, the second generation sub-module includes:
[0038] An adjustment unit for adjusting the size of the image to be detected based on a preset image size;
[0039] A generation unit for inputting the image to be detected with adjusted size into the feature extraction model to generate the image feature map.
[0040] Optionally, the matching sub-module includes:
[0041] Retrieving the feature vector length feature based on the wire plug image coordinate position as the plug feature vector.
[0042] Optionally, the judgment module includes:
[0043] A determination sub-module for determining the similarity between multiple wire plugs based on multiple plug feature vectors;
[0044] A judgment sub-module for sorting multiple similarities and judging two wire plugs corresponding to the same wire based on the sorting result to generate the wire detection result.
[0045] Optionally, the determination sub-module includes:
[0046] Calculating the similarity between multiple wire plugs using the Euclidean distance algorithm based on multiple plug feature vectors.
[0047] Optionally, the judgment sub-module includes:
[0048] Selecting two wire plugs corresponding to the minimum similarity to obtain that the two wire plugs are connected to the same wire.
[0049] In the third aspect of the present application, a computer device is further proposed, including a processor and a memory. Among them, the memory is used to store a computer program, and the computer program includes a program. The processor is configured to call the computer program to execute the method in the first aspect above.
[0050] In the fourth aspect of the present application, an embodiment of the present invention provides a computer-readable storage medium. The computer storage medium stores a computer program, and the computer program is executed by a processor to implement the method in the first aspect above. Description of the Drawings
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0052] Figure 1 It is a flowchart of a wire detection method for experimental operations in Embodiment 1 of the present invention;
[0053] Figure 2 It is a flowchart of step S101 in Embodiment 1 of the present invention;
[0054] Figure 3 It is a schematic diagram of the image coordinate position of the wire plug in Embodiment 1 of the present invention;
[0055] Figure 4 It is a flowchart of step S1012 in Embodiment 1 of the present invention;
[0056] Figure 5 It is a flowchart of step S102 in Embodiment 1 of the present invention;
[0057] Figure 6 It is a principle block diagram of a wire detection device for experimental operations in Embodiment 2 of the present invention. Specific Embodiments
[0058] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the drawings. Obviously, the described embodiments are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0059] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0060] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0061] Embodiment 1
[0062] This embodiment provides a wire detection method for experimental operations, as Figure 1 shown, including the following steps:
[0063] S101. Obtain an image to be detected, detect the wire plugs in the image to be detected, and generate plug feature vectors.
[0064] Among them, the camera is arranged directly above the physical electrical experiment table to obtain the image to be detected in real time. The image to be detected is used to present the operation information of students performing physical electrical experiment operations.
[0065] S102. Based on the plug feature vectors, determine the wire plugs corresponding to the same wire, and generate a wire detection result.
[0066] For the above wire detection method for experimental operations, due to the characteristics of large wire span and unfixed shape, the wire plugs of the wire are detected, and whether the plugs belong to the same wire is judged through the plug feature vectors. The scale of the wire plugs is unique, the accuracy is high, the detection error of the wire is reduced, and the detection noise is reduced.
[0067] Preferably, as Figure 2 shown, in step S101, the detection of the wire plugs in the image to be detected and the generation of plug feature vectors include:
[0068] S1011. Input the image to be detected into the target detection model to generate the image coordinate position of the wire plug.
[0069] Among them, as Figure 3 shown, the image coordinate position of the wire plug is a two-dimensional coordinate, and the origin of the image to be detected is the upper left corner image coordinate (0, 0). Figure 2 The bounding box surrounding the target is the visualized result of the image position recognized by the target detection. The output of the target detection model is (x, y, w, h), where x represents the abscissa of the upper left corner of the bounding box, y represents the ordinate of the upper left corner of the bounding box, and w and h respectively represent the width and height of the bounding box. After visualization, it is Figure 2 the square box surrounding the target to be detected. Among them, Figure 2 the number after the target name in
[0070] Further, the process of training the target detection model is as follows: The training samples are labeled images. The original image before labeling is used as the input data, and the image after labeling (i.e., the image coordinate position of the wire plug) is used as the output result. The original image before labeling is input into the above image detection model, and the position of the image plug is output. The position of the image plug is compared with the image coordinate position of the wire plug in the training sample. When the position of the image plug is the same as the image coordinate position of the wire plug in the training sample, the training of the target detection model is completed. When the position of the image plug is different from the image coordinate position of the wire plug in the training sample, the parameters of each convolutional neural network layer of the target detection model are adjusted, and the original image before labeling is continuously input into the target detection model with adjusted parameters for training until the position of the image plug is the same as the image coordinate position of the wire plug in the training sample, and the trained target detection model is output.
[0071] S1012. Input the image to be detected into the feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position.
[0072] Among them, the image feature map has 64 channels, indicating that 64 implicit features at each position in the image to be detected are extracted.
[0073] S1013. Match the image coordinate position of the wire plug with the image feature map to generate a plug feature vector (64-dimensional).
[0074] Preferably, as Figure 4 shown, inputting the above image to be detected into the feature extraction model in step S1012 to generate an image feature map includes:
[0075] S10121. Adjust the size of the above image to be detected based on a preset image size.
[0076] Specifically, the preset image size is (3, 640, 640). The image to be detected is scaled based on the above preset image size to (3, 640, 640). 3 represents the number of image channels, and 640 represents the width and height of the image.
[0077] Further, when adjusting the size of the image to be detected, only adjust the number of image channels, and do not adjust the width and height of the detected image to ensure the fixation of the image coordinate position of the wire plug.
[0078] S10122. Input the image to be detected with adjusted size into the above feature extraction model to generate the above image feature map.
[0079] Specifically, a convolutional neural network is used to train the feature extraction model. The training process is as follows: Raw images and corresponding image feature maps are collected in advance. The collected raw images are used as input quantities and input into the convolutional neural network. Through convolution operations between filters and additive bias vectors, feature maps are generated in the first layer of the convolutional neural network. Then, weighted average summation is performed on the local regions of each feature map. After adding a bias, a new feature map is obtained through a non-linear activation function in the subsampling layer of the first layer. Furthermore, the feature map is convolved with the trainable filters of the second layer of the convolutional neural network, and a new feature map is output through the subsampling layer of the second layer. The new feature map is vectorized and input into the neural network for training to output an image feature vector. The image feature vector is compared with the feature vector in the image feature map corresponding to the raw image. When the image feature vector matches the feature vector in the image feature map corresponding to the raw image, the feature extraction model is output. When the image feature vector does not match the feature vector in the image feature map corresponding to the raw image, the relevant parameters of the neural network are adjusted until the image feature vector matches the feature vector in the image feature map corresponding to the raw image, and the trained feature extraction model is output.
[0080] Among them, the above-mentioned image feature map includes the feature vector length features corresponding to the feature of each image coordinate position. Among them, the image feature map is (64, 640, 640). 64 indicates that the length of the feature vector at each image coordinate position in the image is 64, and 640 indicates the width and height of the feature map (i.e., the feature of the image coordinate position). The feature of each pixel point is a 64-dimensional feature vector.
[0081] Furthermore, the feature vector length feature corresponding to the image coordinate position of the above-mentioned wire plug is retrieved as the above-mentioned plug feature vector. For example, the 64-dimensional feature vector length feature corresponding to the image coordinate position feature (80, 80) of the wire plug is retrieved as the plug feature vector.
[0082] By adjusting the size of the image to be detected as above, the image to be detected is made to have the same size as the image feature map. And the feature extraction model is used to extract features from the image to be detected, generating an image feature map corresponding to the image to be detected. The image coordinate position feature and the feature vector length feature it contains lay the foundation for the subsequent matching of the image coordinate position of the wire plug and the image feature map. And based on the image coordinate position of the wire plug, the above-mentioned image coordinate position feature of the wire plug is selected, and then the feature vector length feature corresponding to the image coordinate position feature of the wire plug is retrieved, improving the extraction accuracy of the feature vector corresponding to the wire plug.
[0083] Preferably, as Figure 5As shown in the figure, in step S102, the method for determining the wire plugs corresponding to the same wire based on the plug feature vectors and generating a wire detection result includes:
[0084] S1021. Determine the similarity between multiple wire plugs based on multiple plug feature vectors.
[0085] Specifically, based on the plug feature vectors (64 - dimensional) corresponding to all wire plugs, the similarity between all wire plugs is calculated pairwise using the Euclidean distance. The specific calculation formula is as follows:
[0086]
[0087] In the above formula, d represents the similarity, x n represents the plug feature vector corresponding to the wire plug, n = 1, 2, 3, … 64, and y n represents the plug feature vector corresponding to another wire plug, n = 1, 2, 3, … 64.
[0088] S1022. Sort the multiple similarities, and judge the two wire plugs corresponding to the same wire based on the sorting result to generate the above - mentioned wire detection result.
[0089] Among them, since the Euclidean distance between the plug feature vectors of the two plugs on the same wire is as close as possible, and the Euclidean distance between the plug feature vectors of the plugs on different wires is as far as possible, the similarities between the wire plugs are sorted from small to large, and the wire plugs corresponding to the smallest similarity are selected as the two wire plugs connected by the same wire.
[0090] Furthermore, obtain the devices connected by the two wire plugs of the same wire, and then judge the wire connections between different devices, so as to judge whether the student's operation steps are correct and whether the electrical instruments are correctly connected.
[0091] The above method calculates the similarity between wire plugs through plug feature vectors, sorts the similarities, judges the above - mentioned wire plugs corresponding to the same wire based on the sorting result, and judges whether the connection between the wire plug and the wire is correct based on the similarity between the wire plugs, reducing the detection error of the wire and providing a basis for the automatic scoring of physical electrical experiment operations.
[0092] Embodiment 2
[0093] This embodiment provides a wire detection device for experimental operations. As Figure 6 shown, it includes:
[0094] A detection module 61, configured to obtain a to - be - detected image, detect the wire plugs in the to - be - detected image, and generate plug feature vectors.
[0095] Among them, the camera is arranged directly above the physical electrical experiment table to obtain the image to be detected in real time. The image to be detected is used to present the operation information of the student performing the physical electrical experiment operation.
[0096] The judgment module 62 is used to judge the wire plugs corresponding to the same wire based on the plug feature vector and generate a wire detection result.
[0097] For the above-mentioned wire detection device for experimental operations, due to the characteristics of large wire span and unfixed shape, the wire plugs of the wire are detected, and it is judged whether the plugs belong to the same wire through the plug feature vector. The scale of the wire plug is unique, the accuracy is high, the detection error of the wire is reduced, and the detection noise is reduced.
[0098] Preferably, the above-mentioned detection module 61 includes:
[0099] The first generation sub-module 611 is used to input the image to be detected into the target detection model to generate the image coordinate position of the wire plug.
[0100] Among them, as Figure 3 shown, the image coordinate position of the wire plug is a two-dimensional coordinate, and the origin of the image to be detected is the upper left corner image coordinate (0, 0). Figure 2 The bounding box surrounding the target in is the result of visualizing the image position recognized by the target detection. The output of the target detection model is (x, y, w, h), where x represents the abscissa of the upper left corner of the bounding box, y represents the ordinate of the upper left corner of the bounding box, and w and h respectively represent the width and height of the bounding box. After visualization, it is Figure 2 the square box surrounding the target to be detected in. Among them, Figure 2 the number after the target name in represents the probability that the target detection model recognizes the target as a specific target. For example, bulb 0.91 means that the probability of recognizing the object surrounded by the bounding box as a bulb is 0.91; furthermore, based on the recognition result of the wire plug by the target detection model, that is, the abscissa, ordinate of the upper left corner of the bounding box of each wire plug, and the width and height of the bounding box, calculate the center image coordinate of the bounding box, and use this image coordinate as the image coordinate position of the wire plug. For example, the image coordinate position of the wire plug is (80, 80).
[0101] Further, the process of training the target detection model is as follows: The training samples are labeled images. The original image before labeling is used as the input data, and the image after labeling (i.e., the image coordinate position of the wire plug) is used as the output result. The original image before labeling is input into the above image detection model, and the image plug position is output. The image plug position is compared with the wire plug image coordinate position in the training sample. When the image plug position is the same as the wire plug image coordinate position in the training sample, the training of the target detection model is completed. When the image plug position is different from the wire plug image coordinate position in the training sample, the parameters of each convolutional neural network layer of the target detection model are adjusted, and the original image before labeling is continuously input into the target detection model with adjusted parameters for training until the image plug position is the same as the wire plug image coordinate position in the training sample, and the trained target detection model is output.
[0102] The second generation sub-module 612 is used to input the image to be detected into the feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position.
[0103] Among them, the image feature map has 64 channels, indicating that 64 implicit features at each position in the image to be detected are extracted.
[0104] The matching sub-module 613 is used to match the wire plug image coordinate position with the image feature map to generate a plug feature vector.
[0105] Preferably, the above generation module 612 includes:
[0106] The adjustment unit 6121 is used to adjust the size of the above image to be detected based on a preset image size.
[0107] Specifically, the preset image size is (3, 640, 640). The image to be detected is scaled based on the above preset image size to (3, 640, 640). 3 represents the number of image channels, and 640 represents the width and height of the image.
[0108] Further, when the size of the image to be detected is adjusted, only the number of image channels is adjusted, and the width and height of the detected image are not adjusted to ensure the fixation of the wire plug image coordinate position.
[0109] The generation unit 6122 is used to input the image to be detected with adjusted size into the above feature extraction model to generate the above image feature map.
[0110] Specifically, a convolutional neural network is used to train the feature extraction model. The training process is as follows: Raw images and corresponding image feature maps are collected in advance. The collected raw images are input into the convolutional neural network as input quantities. Through convolution operations of filters and additive bias vectors, feature maps are generated in the first layer of the convolutional neural network. Then, weighted average summation is performed on the local regions of each feature map. After adding bias, a new feature map is obtained through a non-linear activation function in the subsampling layer of the first layer. Furthermore, the feature map is convolved with the trainable filters of the second layer of the convolutional neural network, and a new feature map is output through the subsampling layer of the second layer. The new feature map is vectorized and input into the neural network for training to output an image feature vector. The image feature vector is compared with the feature vector in the image feature map corresponding to the raw image. When the image feature vector matches the feature vector in the image feature map corresponding to the raw image, the feature extraction model is output. When the image feature vector does not match the feature vector in the image feature map corresponding to the raw image, the relevant parameters of the neural network are adjusted until the image feature vector matches the feature vector in the image feature map corresponding to the raw image, and the trained feature extraction model is output.
[0111] Among them, the above-mentioned image feature map includes: image coordinate position features and feature vector length features corresponding to the above-mentioned image coordinate position features. Among them, the image feature map is (64, 640, 640). 64 indicates that the feature vector length feature of each coordinate position in the image is 64, and 640 indicates the width and height of the feature map (i.e., the image coordinate position features). The feature of each pixel point is a 64-dimensional feature vector.
[0112] Furthermore, the feature vector length feature corresponding to the image coordinate position of the above-mentioned wire plug is retrieved as the above-mentioned plug feature vector. For example, the 64-dimensional feature vector length feature corresponding to the image coordinate position feature (80, 80) of the wire plug is retrieved as the plug feature vector.
[0113] By adjusting the size of the image to be detected as described above, the image to be detected is made to have the same size as the image feature map. And the feature extraction model is used to extract features from the image to be detected, generating an image feature map corresponding to the image to be detected. The image coordinate position features and feature vector length features it contains lay the foundation for the subsequent matching of the wire plug image coordinate position and the image feature map. And based on the wire plug image coordinate position, the above-mentioned wire plug image coordinate position features are selected, and then the feature vector length feature corresponding to the wire plug image coordinate position feature is retrieved, improving the extraction accuracy of the corresponding feature vector of the wire plug.
[0114] Optionally, the above-mentioned judgment module 62 includes:
[0115] A determination sub-module 621, configured to determine the similarity between multiple wire plugs based on the multiple plug feature vectors.
[0116] Specifically, based on the plug feature vectors (64-dimensional) corresponding to all the wire plugs, the similarity between all the wire plugs is calculated pairwise using the Euclidean distance. The specific calculation formula is as follows:
[0117]
[0118] In the above formula, d represents the similarity, and x n represents the plug feature vector corresponding to the wire plug, where n = 1, 2, 3,... 64, and y n represents the plug feature vector corresponding to another wire plug, where n = 1, 2, 3,... 64.
[0119] A judgment sub-module 622, configured to sort the multiple similarities, and judge the two wire plugs corresponding to the same wire based on the sorting result to generate the wire detection result.
[0120] Among them, since the Euclidean distance between the plug feature vectors of the two plugs on the same wire is as close as possible, and the Euclidean distance between the plug feature vectors of the plugs on different wires is as far as possible, the similarities between the wire plugs are sorted from small to large, and the wire plugs corresponding to the smallest similarity are selected as the two wire plugs connected by the same wire.
[0121] Further, obtain the devices accessed by the two wire plugs connected by the same wire, and then judge the wire connections between different devices, so as to judge whether the student's operation steps are correct and whether the electrical instruments are correctly connected.
[0122] Calculating the similarity between wire plugs through the plug feature vectors, sorting the similarities, judging the wire plugs corresponding to the same wire based on the sorting result, and judging whether the connection between the wire plug and the wire is correct based on the similarity between the wire plugs reduce the detection error of the wire and provide a basis for the automatic scoring of physical electrical experiment operations.
[0123] Embodiment 3
[0124] This embodiment provides a computer device, including a memory and a processor. The processor is configured to read the instructions stored in the memory to execute a wire detection method for experimental operations in any of the above method embodiments.
[0125] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0127] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that realizes the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0129] Embodiment 4
[0130] This embodiment provides a computer-readable storage medium, which stores computer-executable instructions that can execute a wire detection method for experimental operations in any of the above method embodiments. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memories.
[0131] Obviously, the above embodiments are merely examples for clear illustration and not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. And the obvious changes or variations derived therefrom are still within the protection scope of the present invention.
Claims
1. A wire detection method for experimental operations, characterized in that, It includes the following steps: Obtain the image to be detected, detect the wire plugs in the image to be detected, and generate plug feature vectors; Based on the plug feature vectors, determine the wire plugs corresponding to the same wire, and generate wire detection results; The obtaining the image to be detected, detecting the wire plugs in the image to be detected, and generating plug feature vectors includes: Input the image to be detected into a target detection model to generate the image coordinate positions of the wire plugs; Input the image to be detected into a feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position; Match the image coordinate positions of the wire plugs with the image feature map to generate plug feature vectors; The inputting the image to be detected into the feature extraction model to generate the image feature map includes: Adjust the size of the image to be detected based on a preset image size; Input the image to be detected with the adjusted size into the feature extraction model to generate the image feature map; The matching the image coordinate positions of the wire plugs with the image feature map to generate plug feature vectors includes: Retrieve the feature vector length features based on the image coordinate positions of the wire plugs as the plug feature vectors.
2. The wire detection method for experimental operation according to claim 1, characterized in that, The determining, based on the plug feature vectors, the wire plugs corresponding to the same wire and generating wire detection results includes: Determine the similarity between multiple wire plugs based on multiple plug feature vectors; Sort the multiple similarities, and based on the sorting result, judge the two wire plugs corresponding to the same wire to generate the wire detection result.
3. A wire detection method for experimental operations according to claim 2, characterized in that, The determining the similarity between multiple wire plugs based on multiple plug feature vectors includes: Based on multiple plug feature vectors, use the Euclidean distance algorithm to calculate the similarity between multiple wire plugs.
4. The wire detection method for experimental operation according to claim 2, characterized in that, The judging, based on the sorting result, the two wire plugs corresponding to the same wire to generate the wire detection result includes: Select the two wire plugs corresponding to the minimum similarity to obtain that the two wire plugs are connected to the same wire.
5. A wire detection device for experimental operations, characterized in that, It includes: A detection module, configured to obtain the image to be detected, detect the wire plugs in the image to be detected, and generate plug feature vectors; A judgment module, configured to determine the wire plugs corresponding to the same wire based on the plug feature vectors and generate wire detection results; The detection module includes: A first generation sub-module, configured to input the image to be detected into a target detection model to generate the image coordinate positions of the wire plugs; A second generation sub-module, configured to input the image to be detected into a feature extraction model to generate an image feature map, where the image feature map includes the feature vector length features corresponding to each image coordinate position; A matching sub-module, configured to match the image coordinate positions of the wire plugs with the image feature map to generate plug feature vectors; The second generation sub-module includes: An adjustment unit, configured to adjust the size of the image to be detected based on a preset image size; A generating unit, configured to input the image to be detected after size adjustment into the feature extraction model to generate the image feature map; The matching sub-module includes: Based on the image coordinate position of the wire plug, the feature vector length feature is retrieved as the plug feature vector.
6. The wire detection device for experimental operation according to claim 5, characterized in that, The judging module includes: A determining sub-module, configured to determine the similarity between multiple wire plugs based on multiple plug feature vectors; A judging sub-module, configured to sort multiple similarities, and judge two wire plugs corresponding to the same wire based on the sorting result to generate the wire detection result.
7. The wire detection device for experimental operation according to claim 6, wherein, The determining sub-module includes: Based on multiple plug feature vectors, the Euclidean distance algorithm is used to calculate the similarity between multiple wire plugs.
8. The wire detection device for experimental operation according to claim 6, characterized in that, The judging sub-module includes: Select two wire plugs corresponding to the minimum similarity to obtain that the two wire plugs are connected to the same wire.
9. A computer device, characterized in that, It includes a processor and a memory. The memory is used to store a computer program, and the processor is configured to call the computer program to execute the steps of the method according to any one of claims 1-4.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that, When the computer instructions are executed by the processor, the steps of the method according to any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Circuit connection analysis algorithm based on image deep learning
CN114418020A