Instrument screw counting method, system and equipment and storage medium

The screw counting method combining YOLO11 and ResNet18 network modules solves the problems of low speed and accuracy of manual counting, and achieves efficient and accurate identification and duplicate counting filtering of instrument screws, thus improving counting efficiency and accuracy.

CN121504810AActive Publication Date: 2026-02-10YIYANG CENT HOSPITAL
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511441138.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-02-10
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

In existing technologies, the counting of instrument screws mainly relies on manual counting, which has problems with low counting speed and accuracy.

Method used

The YOLO11 network module is used for screw candidate region recognition, and the ResNet18 network module is used for screw counting. By calculating the attributes of the largest bounding rectangle image and the screw counting results, the screws in the image can be efficiently and quickly locked and accurately identified in the second stage. The final screw counting results are then filtered and calculated.

Benefits of technology

It improves the accuracy and efficiency of instrument screw counting. By combining region recognition and counting models, it achieves efficient and rapid locking and accurate secondary recognition of screws within images, reducing errors from repeated counting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504810A_ABST
    Figure CN121504810A_ABST
Patent Text Reader

Abstract

The invention discloses an instrument screw counting method, system and device and a storage medium. The instrument screw counting method comprises the steps that an image of a to-be-detected instrument screw is acquired; inputting an instrument screw image to be detected into the trained region recognition model to obtain a screw candidate region image output by the trained region recognition model, and inputting the screw candidate region image into a trained instrument screw counting model, obtaining a first maximum circumscribed rectangular image, attributes of the first maximum circumscribed rectangular image and a first screw counting result output by the trained instrument screw counting model, and calculating a second screw counting result based on the first maximum circumscribed rectangular image, the attributes of the first maximum circumscribed rectangular image and the first screw counting result; and the second screw counting result is used as the screw counting result of the to-be-detected instrument screw image, so that the accuracy and efficiency of instrument screw counting are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of instrument screw counting, and in particular to an instrument screw counting method, system, device and storage medium. BACKGROUND

[0002] As a fixing part, screws have a large amount of use in screw instruments in a disinfection supply center. In order to avoid the occurrence of missing screws, the number of screws in the screw instrument needs to be detected to ensure that the reliability and safety of the screw instrument meet the requirements.

[0003] At present, the number of screws is mainly detected by manual counting, which has the problem of low counting speed and accuracy. SUMMARY

[0004] The present application aims to at least solve the technical problems existing in the prior art. To this end, the present application provides an instrument screw counting method, system, device and storage medium, which can improve the accuracy and efficiency of instrument screw counting.

[0005] In a first aspect, the present application provides an instrument screw counting method, comprising the following steps: obtaining a to-be-detected instrument screw image; inputting the to-be-detected instrument screw image into a trained region recognition model to obtain a screw candidate region image output by the trained region recognition model, wherein the region recognition model comprises a YOLO11 network module; inputting the screw candidate region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, attributes of the first maximum bounding rectangle image and a first screw counting result output by the trained instrument screw counting model, wherein the instrument screw counting model comprises a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values for representing whether there is a screw in the first maximum bounding rectangle image; calculating a second screw counting result based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image and the first screw counting result; taking the second screw counting result as a screw counting result of the to-be-detected instrument screw image.

[0006] According to the control method of the present application, at least the following beneficial effects are achieved: The method comprises the following steps: acquiring a to-be-detected instrument screw image; inputting the to-be-detected instrument screw image into a trained region identification model to obtain a screw candidate region image output by the trained region identification model, wherein the region identification model comprises a YOLO11 network module; inputting the screw candidate region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, an attribute of the first maximum bounding rectangle image and a first screw counting result output by the trained instrument screw counting model, wherein the instrument screw counting model comprises a ResNet18 network module, the attribute of the first maximum bounding rectangle image is a constant value used to represent whether there is a screw in the first maximum bounding rectangle image; calculating a second screw counting result based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image and the first screw counting result; and taking the second screw counting result as a screw counting result of the to-be-detected instrument screw image. According to the method, the screw candidate region image output by the region identification model is used to realize efficient and rapid locking of all screws in the image, then the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image and the first screw counting result output by the instrument screw counting model are used to realize secondary accurate identification of all screws in the image, and finally the second screw counting result is calculated based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image and the first screw counting result to complete filtering of repeated counting, thereby improving the accuracy and efficiency of instrument screw counting.

[0007] According to some embodiments of the present application, the calculating of the second screw counting result based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image and the first screw counting result comprises: screening all the first maximum bounding rectangle images with the attribute of the first maximum bounding rectangle image being a first preset attribute value as second maximum bounding rectangle images; obtaining a minimum horizontal coordinate value and a minimum vertical coordinate value of each second maximum bounding rectangle image; calculating a difference absolute value of the minimum horizontal coordinate values of each two second maximum bounding rectangle images as a horizontal coordinate distance value, and calculating a difference absolute value of the minimum vertical coordinate values of each two second maximum bounding rectangle images as a vertical coordinate distance value, the horizontal coordinate distance value and the vertical coordinate distance value corresponding to each other; calculating a second screw counting result based on the horizontal coordinate distance value, the vertical coordinate distance value and the first screw counting result.

[0008] According to some embodiments of the present application, the calculating of the second screw counting result based on the horizontal coordinate distance value, the vertical coordinate distance value and the first screw counting result comprises: In a case where a plurality of the abovementioned horizontal coordinate distance values exist, the plurality of the abovementioned horizontal coordinate distance values are less than a first preset threshold, and the abovementioned plurality of the horizontal coordinate distance values correspond to the abovementioned vertical coordinate distance values which are less than a second preset threshold, the plurality of the abovementioned horizontal coordinate distance values are taken as a first horizontal coordinate distance value. The first screw counting result is subtracted by a total number of the plurality of the horizontal coordinate distance values, so as to obtain the second screw counting result.

[0009] According to some embodiments of the present application, the training process of the instrument screw counting model comprises: obtaining a historical instrument screw image dataset, wherein the historical instrument screw image dataset is a labeled image dataset of screws of different types in different states; constructing an initial instrument screw counting model, training the initial instrument screw counting model based on the historical instrument screw image dataset through a 5-fold cross-validation method, and obtaining the trained instrument screw counting model.

[0010] According to some embodiments of the present application, before the obtaining of the to-be-detected instrument screw image, the method comprises: receiving a voice instruction of a user through a microphone, wherein the voice instruction comprises a counting instruction and a control lifting rod instruction, and the lifting rod is provided with a high-definition camera; inputting the voice instruction into a trained voice recognition model to obtain a voice recognition result; according to the voice recognition result, capturing an initial to-be-detected instrument screw image through the high-definition camera; the obtaining of the to-be-detected instrument screw image comprises: performing image preprocessing on the initial to-be-detected instrument screw image to obtain the to-be-detected instrument screw image.

[0011] According to some embodiments of the present application, the image preprocessing on the initial to-be-detected instrument screw image to obtain the to-be-detected instrument screw image comprises: graying the initial to-be-detected instrument screw image to obtain a grayed image; performing denoising on the grayed image to obtain a denoised image; performing edge enhancement on the denoised image to obtain the to-be-detected instrument screw image.

[0012] According to some embodiments of the present application, the method further comprises: sending the screw counting result of the to-be-detected instrument screw image to a loudspeaker, so as to broadcast the screw counting result to the user through the loudspeaker.

[0013] In a second aspect, the application provides an instrument screw counting system, comprising: a data acquisition module configured to acquire an instrument screw image to be detected; a screw candidate region image output module configured to input the instrument screw image to be detected into a trained region identification model to obtain a screw candidate region image output by the trained region identification model, wherein the region identification model comprises a YOLO11 network module; a second screw counting result output module configured to input the screw candidate region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, an attribute of the first maximum bounding rectangle image, and a first screw counting result output by the trained instrument screw counting model, wherein the instrument screw counting model comprises a ResNet18 network module, and the attribute of the first maximum bounding rectangle image is a constant value used to represent whether there is a screw in the first maximum bounding rectangle image; a second screw counting result calculation module configured to calculate a second screw counting result based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image, and the first screw counting result; a screw counting result determination module configured to take the second screw counting result as a screw counting result of the instrument screw image to be detected.

[0014] The system acquires an instrument screw image to be detected, inputs the instrument screw image to be detected into a trained region identification model to obtain a screw candidate region image output by the trained region identification model, wherein the region identification model comprises a YOLO11 network module, inputs the screw candidate region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, an attribute of the first maximum bounding rectangle image, and a first screw counting result output by the trained instrument screw counting model, wherein the instrument screw counting model comprises a ResNet18 network module, the attribute of the first maximum bounding rectangle image is a constant value used to represent whether there is a screw in the first maximum bounding rectangle image, calculates a second screw counting result based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image, and the first screw counting result, and takes the second screw counting result as a screw counting result of the instrument screw image to be detected. The application first realizes efficient and rapid locking of all screws in the image through the screw candidate region image output by the region identification model, then realizes secondary accurate identification of all screws in the image through the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image, and the first screw counting result output by the instrument screw counting model, and finally completes filtering of repeated counting based on the first maximum bounding rectangle image, the attribute of the first maximum bounding rectangle image, and the first screw counting result, thereby improving the accuracy and efficiency of instrument screw counting.

[0015] In a third aspect, the present application provides an apparatus screw counting electronic device, comprising at least one control processor and a memory connected to the at least one control processor in communication; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to perform the apparatus screw counting method described above.

[0016] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer executable instructions for causing a computer to perform the apparatus screw counting method described above.

[0017] It should be noted that the beneficial effects between the second aspect to the fourth aspect of the present application and the prior art are the same as the beneficial effects between the apparatus screw counting system described above and the prior art, which will not be described here.

[0018] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0019] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the accompanying drawings, in which: Figure 1 is a flowchart of the apparatus screw counting method provided by the present application; Figure 2 is a structural schematic diagram of an embodiment of the apparatus screw counting system provided by the present application; Figure 3 is a structural schematic diagram of an embodiment of the electronic device provided by the present application. DETAILED DESCRIPTION

[0020] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0021] In the description of the present application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the sequence of indicated technical features.

[0022] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0023] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0024] As a type of fixing component, screws are used in large quantities in screw-type instruments in sterilization supply centers. To avoid missing screws, it is necessary to check the number of screws in screw-type instruments to ensure that the reliability and safety of screw-type instruments meet the requirements.

[0025] Currently, the number of screws is mainly detected by manual counting, which has problems with low counting speed and accuracy.

[0026] To address the aforementioned technical deficiencies, embodiments of this application provide a method, system, device, and storage medium for counting instrument screws.

[0027] Please see Figure 1 This is a flowchart illustrating a method for counting mechanical screws according to an embodiment of this application. This method is applied to electronic devices, such as servers. Figure 1 As shown, the screw counting method for this instrument includes: Step S101: Obtain an image of the screw of the instrument to be tested; Step S102: Input the screw image of the instrument to be detected into the trained region recognition model to obtain the screw candidate region image output by the trained region recognition model. The region recognition model includes a YOLO11 network module. Step S103: Input the candidate region image of the screw into the trained instrument screw counting model to obtain the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result output by the trained instrument screw counting model. The instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether there is a screw in the first maximum bounding rectangle image. Step S104: Calculate the second screw count result based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw count result; Step S105: Use the second screw count result as the screw count result of the screw image of the instrument to be tested.

[0028] The first screw count result is equal to the number of first preset attribute values ​​of the attribute of the first maximum bounding rectangle image.

[0029] The attribute value of the first maximum bounding rectangle image can also be a second preset attribute value. The second preset attribute value is a value preset according to actual needs, used to indicate that there are no screws in the first maximum bounding rectangle image, and can be 0.

[0030] The first preset attribute value mentioned above is a value set in advance according to actual needs, used to indicate that there is a screw in the first maximum bounding rectangle image, and can be 1.

[0031] The anchor frame size of the YOLO11 network module can be a pre-set size that matches the actual size of the screw, such as [10,13] or [16,30].

[0032] This method acquires an image of a screw in an instrument to be detected; inputs the screw image into a trained region recognition model to obtain a candidate screw region image output by the trained region recognition model, wherein the region recognition model includes a YOLO11 network module; inputs the candidate screw region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and a first screw count result output by the trained instrument screw counting model, wherein the instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether a screw exists in the first maximum bounding rectangle image; based on the first maximum bounding rectangle image, the first maximum bounding rectangle image, the first maximum bounding rectangle image, and the first maximum bounding rectangle image, the method obtains a candidate screw region image output by the trained instrument screw counting model, wherein ... The second screw count result is calculated based on the attributes of the circumscribed rectangle image and the first screw count result. The second screw count result is used as the screw count result of the screw image of the instrument to be detected. This application first achieves efficient and rapid locking of all screws in the image by using the screw candidate region image output by the region recognition model. Then, it achieves secondary accurate recognition of all screws in the image by using the first maximum circumscribed rectangle image, the attributes of the first maximum circumscribed rectangle image, and the first screw count result output by the instrument screw counting model. Finally, the second screw count result is calculated based on the first maximum circumscribed rectangle image, the attributes of the first maximum circumscribed rectangle image, and the first screw count result to filter duplicate counts, thereby improving the accuracy and efficiency of instrument screw counting.

[0033] In some embodiments, step S104 may include, but is not limited to, steps S201 to S204: Step S201: Filter out all first maximum bounding rectangle images whose attributes are the first preset attribute values, and use them as second maximum bounding rectangle images; Step S202: Obtain the minimum x-coordinate and minimum y-coordinate values ​​of each second maximum bounding rectangle image; Step S203: Calculate the absolute value of the difference between the minimum abscissa values ​​of every two second maximum bounding rectangle images, and use it as the abscissa distance value; calculate the absolute value of the difference between the minimum ordinate values ​​of every two second maximum bounding rectangle images, and use it as the ordinate distance value. The abscissa distance value and the ordinate distance value correspond one-to-one. Step S204: Calculate the second screw count result based on the horizontal coordinate distance value, the vertical coordinate distance value, and the first screw count result.

[0034] This application calculates the second screw count result based on the horizontal axis distance value, the vertical axis distance value, and the first screw count result, thereby filtering out duplicate counts and improving the accuracy and efficiency of instrument screw counting.

[0035] In some embodiments, step S204 may include, but is not limited to, steps S301 to S302: Step S301: When there are several horizontal coordinate distance values, and several horizontal coordinate distance values ​​are less than a first preset threshold, and several horizontal coordinate distance values ​​are less than a second preset threshold, several horizontal coordinate distance values ​​are used as the first horizontal coordinate distance value. Step S302: Subtract the total number of several horizontal coordinate distance values ​​from the first screw count result to obtain the second screw count result.

[0036] The aforementioned first preset threshold is a constant value pre-set according to actual needs.

[0037] The aforementioned second preset threshold is a constant value pre-set according to actual needs.

[0038] This application obtains a second screw count by subtracting the total number of several horizontal coordinate distance values ​​from the first screw count result, thereby eliminating the number of screws counted repeatedly and improving the accuracy of the instrument screw count.

[0039] In some embodiments, the training process of the instrument screw counting model may include, but is not limited to, steps S401 to S402: Step S401: Obtain a historical instrument screw image dataset, wherein the historical instrument screw image dataset is a dataset of labeled images of different types of screws in different states; Step S402: Construct an initial instrument screw counting model. Based on a historical instrument screw image dataset, train the initial instrument screw counting model using a 5-fold cross-validation method to obtain a trained instrument screw counting model.

[0040] The training process of the above-mentioned region recognition model is similar to that of the instrument screw counting model, and will not be described in detail here.

[0041] This application improves the recognition accuracy of the instrument screw counting model by using a 5-fold cross-validation method, so that the instrument screw counting model can better perform secondary accurate identification of all screws, thereby improving the accuracy of instrument screw counting.

[0042] In some embodiments, prior to step S101, steps S501 to S503 may be included, but are not limited to: Step S501: Receive the user's voice commands through the microphone, including counting commands and commands to control the lifting rod, and the lifting rod is equipped with a high-definition camera; Step S502: Input the voice command into the trained speech recognition model to obtain the speech recognition result; Step S503: Based on the voice recognition results, capture an initial image of the screw of the instrument to be tested using a high-definition camera; In some embodiments, step S101 may include, but is not limited to, step S504: Step S504: Perform image preprocessing on the initial image of the screw of the instrument to be tested to obtain the image of the screw of the instrument to be tested.

[0043] The training process of the above speech recognition model is similar to that of the instrument screw counting model, and will not be described in detail here.

[0044] This application utilizes a high-definition camera mounted on a lifting pole to enable adjustable shooting angles. Simultaneously, it employs a voice recognition model to parse voice commands, thereby improving user convenience and the accuracy and efficiency of image data acquisition.

[0045] In some embodiments, step S504 may include, but is not limited to, steps S601 to S603: Step S601: Convert the initial image of the screw of the instrument to be tested to grayscale to obtain the grayscale image; Step S602: Denoise the grayscale image to obtain a denoised image; Step S603: Perform edge enhancement on the denoised image to obtain the screw image of the instrument to be inspected.

[0046] This application preprocesses the initial image of the screw of the instrument to be tested, providing more accurate data for subsequent model recognition.

[0047] In some embodiments, the method may also include, but is not limited to, step S701: Step S701: Send the screw count result of the screw image of the instrument to be tested to the speaker so that the screw count result can be broadcast to the user through the speaker.

[0048] This application improves user convenience by broadcasting the screw count results to the user through a speaker.

[0049] Additionally, refer to Figure 2 One embodiment of this application provides a screw counting system, including a data acquisition module 1100, a screw candidate region image output module 1200, a second screw counting result output module 1300, a second screw counting result calculation module 1400, and a screw counting result determination module 1500, wherein: The data acquisition module 1100 is used to acquire images of the screws of the instrument to be inspected; The screw candidate region image output module 1200 is used to input the screw image of the instrument to be detected into the trained region recognition model to obtain the screw candidate region image output by the trained region recognition model. The region recognition model includes a YOLO11 network module. The second screw counting result output module 1300 is used to input the screw candidate region image into the trained instrument screw counting model to obtain the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result output by the trained instrument screw counting model. The instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether there is a screw in the first maximum bounding rectangle image. The second screw counting result calculation module 1400 is used to calculate the second screw counting result based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result; The screw count result determination module 1500 is used to use the second screw count result as the screw count result of the screw image of the instrument under test.

[0050] This system acquires an image of a screw in an instrument to be detected; inputs the screw image into a trained region recognition model to obtain a candidate screw region image output by the trained region recognition model, wherein the region recognition model includes a YOLO11 network module; inputs the candidate screw region image into a trained instrument screw counting model to obtain a first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and a first screw count result output by the trained instrument screw counting model, wherein the instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether a screw exists in the first maximum bounding rectangle image; based on the first maximum bounding rectangle image, the first maximum bounding rectangle image, the first maximum bounding rectangle image, and the first maximum bounding rectangle image, the system can detect the screws in the first maximum bounding rectangle image. The second screw count result is calculated based on the attributes of the circumscribed rectangle image and the first screw count result. The second screw count result is used as the screw count result of the screw image of the instrument to be detected. This application first achieves efficient and rapid locking of all screws in the image by using the screw candidate region image output by the region recognition model. Then, it achieves secondary accurate recognition of all screws in the image by using the first maximum circumscribed rectangle image, the attributes of the first maximum circumscribed rectangle image, and the first screw count result output by the instrument screw counting model. Finally, the second screw count result is calculated based on the first maximum circumscribed rectangle image, the attributes of the first maximum circumscribed rectangle image, and the first screw count result to filter duplicate counts, thereby improving the accuracy and efficiency of instrument screw counting.

[0051] It should be noted that the system embodiments described above are based on the same inventive concept as the method embodiments described above. Therefore, the relevant content of the method embodiments described above is also applicable to the system embodiments described above, and will not be repeated here.

[0052] Figure 3 A schematic diagram of the hardware structure for counting instrument screws provided in an embodiment of this application is shown.

[0053] The instrument screw counting device may include a processor 301 and a memory 302 storing computer program instructions.

[0054] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0055] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.

[0056] In some embodiments, memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0057] The processor 301 implements any of the instrument screw counting methods in the above embodiments by reading and executing computer program instructions stored in the memory 302.

[0058] In one example, the instrument screw counting device may also include a communication interface 303 and a bus 310. Wherein, as Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.

[0059] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0060] Bus 310 includes hardware, software, or both, that couples components of an instrument screw counting device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0061] This instrument screw counting device can execute the instrument screw counting method in the embodiments of this application based on a three-dimensional design model, thereby achieving a combination of Figure 1 and Figure 2 The instrument screw counting method and system are described.

[0062] Furthermore, in conjunction with the instrument screw counting method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the instrument screw counting methods in the above embodiments.

[0063] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0064] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0065] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0066] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0067] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for counting instrument screws, characterized in that, The instrument screw counting method includes: Acquire images of the screws of the instrument to be inspected; The screw image of the instrument to be detected is input into the trained region recognition model to obtain the screw candidate region image output by the trained region recognition model, wherein the region recognition model includes a YOLO11 network module; The candidate region image of the screw is input into the trained instrument screw counting model to obtain the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result output by the trained instrument screw counting model. The instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether there is a screw in the first maximum bounding rectangle image. The second screw count result is calculated based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw count result; The second screw count result is used as the screw count result of the screw image of the instrument under test.

2. The method for counting instrument screws according to claim 1, characterized in that, The calculation of the second screw count result based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw count result includes: All first maximum bounding rectangle images whose attributes are the first preset attribute values ​​are selected as second maximum bounding rectangle images; Obtain the minimum x-coordinate and minimum y-coordinate values ​​of each of the second maximum bounding rectangle images; Calculate the absolute value of the difference between the minimum abscissa values ​​of every two second maximum bounding rectangle images, and use it as the abscissa distance value; calculate the absolute value of the difference between the minimum ordinate values ​​of every two second maximum bounding rectangle images, and use it as the ordinate distance value, wherein the abscissa distance value and the ordinate distance value correspond one-to-one. The second screw count result is calculated based on the horizontal coordinate distance value, the vertical coordinate distance value, and the first screw count result.

3. The method for counting instrument screws according to claim 2, characterized in that, The calculation of the second screw count result based on the horizontal coordinate distance value, the vertical coordinate distance value, and the first screw count result includes: If there are several horizontal coordinate distance values, and the several horizontal coordinate distance values ​​are less than a first preset threshold, and the vertical coordinate distance values ​​corresponding to the several horizontal coordinate distance values ​​are less than a second preset threshold, then the several horizontal coordinate distance values ​​shall be used as the first horizontal coordinate distance value. The second screw count result is obtained by subtracting the total number of the plurality of horizontal coordinate distance values ​​from the first screw count result.

4. The method for counting instrument screws according to claim 3, characterized in that, The training process for the instrument screw counting model includes: Obtain a historical instrument screw image dataset, wherein the historical instrument screw image dataset is a dataset of labeled images of different types of screws in different states; An initial instrument screw counting model is constructed. Based on the historical instrument screw image dataset, the initial instrument screw counting model is trained using a 5-fold cross-validation method to obtain the trained instrument screw counting model.

5. The method for counting instrument screws according to claim 4, characterized in that, Before acquiring the image of the screw of the instrument to be inspected, the following steps are included: The system receives user voice commands via a microphone, including counting commands and commands to control the lifting rod, which is equipped with a high-definition camera. The voice command is input into the trained speech recognition model to obtain the speech recognition result; Based on the speech recognition results, an initial image of the screw of the instrument to be tested is captured using the high-definition camera; The process of acquiring the image of the screw in the instrument to be inspected includes: The initial image of the screw of the instrument to be tested is preprocessed to obtain the image of the screw of the instrument to be tested.

6. The method for counting instrument screws according to claim 5, characterized in that, The step of preprocessing the initial image of the screw of the instrument to be tested to obtain the image of the screw of the instrument to be tested includes: The initial image of the screw of the instrument to be tested is converted to grayscale to obtain a grayscale image; The grayscale image is denoised to obtain a denoised image; Edge enhancement is performed on the denoised image to obtain the screw image of the instrument to be tested.

7. The method for counting instrument screws according to claim 1, characterized in that, The method further includes: The screw count result of the screw image of the instrument to be tested is sent to a speaker so that the screw count result is broadcast to the user through the speaker.

8. A screw counting system for instruments, characterized in that, The instrument screw counting system includes: The data acquisition module is used to acquire images of the screws of the instrument to be inspected; The screw candidate region image output module is used to input the screw image of the instrument to be detected into a trained region recognition model to obtain the screw candidate region image output by the trained region recognition model, wherein the region recognition model includes a YOLO11 network module. The second screw counting result output module is used to input the screw candidate region image into the trained instrument screw counting model to obtain the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result output by the trained instrument screw counting model. The instrument screw counting model includes a ResNet18 network module, and the attributes of the first maximum bounding rectangle image are constant values ​​used to characterize whether there is a screw in the first maximum bounding rectangle image. The second screw counting result calculation module is used to calculate the second screw counting result based on the first maximum bounding rectangle image, the attributes of the first maximum bounding rectangle image, and the first screw counting result; The screw counting result determination module is used to use the second screw counting result as the screw counting result of the screw image of the instrument under test.

9. A mechanical screw counting device, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform an instrument screw counting method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform an instrument screw counting method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Deformed steel bar surface defect detection method and system based on machine vision

    CN110223296A

  • Calligraphy image recognition method and system based on computer vision algorithm

    CN120411992A

  • Object detection considering tendency of object location

    US20230177813A1

  • Method of and system for performing object recognition in data acquired by ultrawide field of view sensors

    US20240153261A1