An instrument screw counting method, system, device, and storage medium

By combining YOLO11 and ResNet18 network modules, efficient and accurate counting of instrument screws was achieved, solving the problems of low speed and accuracy of manual counting and improving the inspection quality of screw instruments.

CN121504810BActive Publication Date: 2026-05-29YIYANG CENT HOSPITAL

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YIYANG CENT HOSPITAL
Filing Date
2025-10-10
Publication Date
2026-05-29

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. The counting accuracy is improved through image processing and model training, and speech recognition and high-definition camera are used to optimize image acquisition to achieve automated counting.

Benefits of technology

It improves the accuracy and efficiency of screw counting in instruments, reduces the occurrence of missing screws, and enhances the reliability and safety of screw-type instruments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504810B_ABST
    Figure CN121504810B_ABST
Patent Text Reader

Abstract

The application discloses an instrument screw counting method, system, device and storage medium. The instrument screw counting method comprises the following steps: acquiring an instrument screw image to be detected; inputting 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; inputting the screw candidate region image into a trained instrument screw counting model to obtain a first maximum circumscribed rectangle image, attributes of the first maximum circumscribed rectangle 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 rectangle image, the attributes of the first maximum circumscribed rectangle image and the first screw counting result. The second screw counting result is taken as a screw counting result of the instrument screw image to be detected, and 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] This 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 Technology

[0002] 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.

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

[0004] This application aims to at least address the technical problems existing in the prior art. To this end, this application proposes a method, system, device, and storage medium for counting instrument screws, which can improve the accuracy and efficiency of instrument screw counting.

[0005] A first aspect of this application provides a method for counting instrument screws, comprising the following steps:

[0006] Acquire images of the screws of the instrument to be inspected;

[0007] 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;

[0008] 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.

[0009] 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;

[0010] The second screw count result is used as the screw count result of the screw image of the instrument under test.

[0011] The control method according to the embodiments of this application has at least the following beneficial effects:

[0012] 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.

[0013] According to some embodiments of this application, 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:

[0014] All first maximum bounding rectangle images whose attributes are the first preset attribute values ​​are selected as second maximum bounding rectangle images;

[0015] Obtain the minimum x-coordinate and minimum y-coordinate values ​​of each of the second maximum bounding rectangle images;

[0016] 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.

[0017] 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.

[0018] According to some embodiments of this application, 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:

[0019] 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.

[0020] 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.

[0021] According to some embodiments of this application, the training process of the instrument screw counting model includes:

[0022] 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;

[0023] 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.

[0024] According to some embodiments of this application, prior to acquiring the image of the screw of the instrument to be inspected, the following steps are included:

[0025] 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.

[0026] The voice command is input into the trained speech recognition model to obtain the speech recognition result;

[0027] 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;

[0028] The process of acquiring the image of the screw in the instrument to be inspected includes:

[0029] 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.

[0030] According to some embodiments of this application, the step of performing image preprocessing on the initial image of the screw to be tested to obtain the image of the screw to be tested includes:

[0031] The initial image of the screw of the instrument to be tested is converted to grayscale to obtain a grayscale image;

[0032] The grayscale image is denoised to obtain a denoised image;

[0033] Edge enhancement is performed on the denoised image to obtain the screw image of the instrument to be detected.

[0034] According to some embodiments of this application, the method further includes:

[0035] 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.

[0036] A second aspect of this application provides a medical device screw counting system, the medical device screw counting system comprising:

[0037] The data acquisition module is used to acquire images of the screws of the instrument to be inspected;

[0038] 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.

[0039] 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.

[0040] 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;

[0041] 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.

[0042] 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.

[0043] A third aspect of this application provides an electronic device for counting instrument screws, including 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, which, when executed by the at least one control processor, enables the at least one control processor to perform the aforementioned instrument screw counting method.

[0044] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-described instrument screw counting method.

[0045] It should be noted that the beneficial effects of the second to fourth aspects of this application with respect to the prior art are the same as the beneficial effects of the aforementioned instrument screw counting system with respect to the prior art, and will not be described in detail here.

[0046] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0047] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0048] Figure 1 This is a flowchart of the instrument screw counting method provided in this application;

[0049] Figure 2 This is a schematic diagram of an embodiment of the instrument screw counting system provided in this application;

[0050] Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application. Detailed Implementation

[0051] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0052] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.

[0053] 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.

[0054] 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.

[0055] 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.

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

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

[0058] Please see Figure 1This 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:

[0059] Step S101: Obtain an image of the screw of the instrument to be tested;

[0060] 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.

[0061] 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.

[0062] 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;

[0063] Step S105: Use the second screw count result as the screw count result of the screw image of the instrument to be tested.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] 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].

[0068] 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.

[0069] In some embodiments, step S104 may include, but is not limited to, steps S201 to S204:

[0070] 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;

[0071] Step S202: Obtain the minimum x-coordinate and minimum y-coordinate values ​​of each second maximum bounding rectangle image;

[0072] 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.

[0073] 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.

[0074] 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.

[0075] In some embodiments, step S204 may include, but is not limited to, steps S301 to S302:

[0076] 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.

[0077] 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.

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

[0079] The aforementioned second preset threshold is a constant value set in advance according to actual needs.

[0080] 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.

[0081] In some embodiments, the training process of the instrument screw counting model may include, but is not limited to, steps S401 to S402:

[0082] 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;

[0083] 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.

[0084] 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.

[0085] 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.

[0086] In some embodiments, prior to step S101, steps S501 to S503 may be included, but are not limited to:

[0087] 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;

[0088] Step S502: Input the voice command into the trained speech recognition model to obtain the speech recognition result;

[0089] 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;

[0090] In some embodiments, step S101 may include, but is not limited to, step S504:

[0091] 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.

[0092] 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.

[0093] 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.

[0094] In some embodiments, step S504 may include, but is not limited to, steps S601 to S603:

[0095] Step S601: Convert the initial image of the screw of the instrument to be tested to grayscale to obtain the grayscale image;

[0096] Step S602: Denoise the grayscale image to obtain a denoised image;

[0097] Step S603: Perform edge enhancement on the denoised image to obtain the screw image of the instrument to be inspected.

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

[0099] In some embodiments, the method may also include, but is not limited to, step S701:

[0100] 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.

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

[0102] Additionally, refer to Figure 2One 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:

[0103] The data acquisition module 1100 is used to acquire images of the screws of the instrument to be inspected;

[0104] 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.

[0105] 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.

[0106] 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;

[0107] 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.

[0108] 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.

[0109] 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.

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

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

[0112] 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.

[0113] 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.

[0114] 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.

[0115] 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.

[0116] 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.

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

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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, specifically as follows: 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, specifically as follows: 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. Subtract the total number of the plurality of horizontal coordinate distance values ​​from the first screw count result to obtain the second 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 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.

3. The method for counting instrument screws according to claim 2, 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.

4. The method for counting instrument screws according to claim 3, 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.

5. 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.

6. 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, specifically: 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, specifically as follows: 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. Subtract the total number of the plurality of horizontal coordinate distance values ​​from the first screw count result to obtain the second screw count 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 to be tested.

7. 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 5.

8. 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 5.