Method and system for detecting alignment of pump end shaft head, device, medium, product
By using image detection and classification algorithms to detect the alignment of the pump end shaft head and the connecting shaft, the problems of low efficiency and insufficient accuracy in traditional detection methods are solved, and efficient and accurate alignment detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WILO CHINA
- Filing Date
- 2024-12-12
- Publication Date
- 2026-06-12
AI Technical Summary
In the traditional water pump assembly process, the misalignment of the pump end shaft and the connecting shaft leads to abnormal wear and reduced efficiency of the equipment. Existing testing methods are inefficient and not accurate enough, especially in complex environments where it is difficult to guarantee high efficiency and high precision.
By employing image detection and image classification algorithms, the connection features between the pump end shaft and the connecting shaft are extracted through the detection model, and the alignment is determined by the classification model, providing an efficient and accurate detection method.
It improves the measurement accuracy of the pump end shaft and connecting shaft, reduces the error in alignment detection, and enhances the accuracy and reliability of detection.
Smart Images

Figure CN122192222A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mechanical equipment assembly technology, and in particular to a method, system, equipment, medium, and product for detecting the alignment of pump end shafts. Background Technology
[0002] The alignment of the pump end shaft and the connecting shaft is crucial for the normal operation of a water pump. However, in traditional water pump assembly processes, the alignment of the pump end shaft and the connecting shaft is a common and serious quality control problem. Even a slight deviation can lead to abnormal wear and reduced efficiency. Alignment refers to the alignment of the axes of the pump end shaft and the connecting shaft in all directions. In actual assembly, the alignment between the pump end shaft and the connecting shaft often relies on manual experience for adjustment and inspection. Manual alignment has certain limitations: it requires a lot of time and effort, has low production efficiency, and cannot achieve precise adjustments. Although some advanced assembly lines have introduced tools such as laser alignment instruments, the environmental conditions under which these tools are used are quite harsh. For example, changes in vibration and lighting conditions can affect the accuracy of the measurements. Therefore, the reliability of existing technologies for aligning and inspecting the pump end shaft and the connecting shaft needs to be improved. Summary of the Invention
[0003] Based on this, a method, system, equipment, medium, and product for detecting the alignment of the pump end shaft are provided, which solves the problem that the existing technology cannot accurately detect whether the pump end shaft is correctly aligned.
[0004] Firstly, a method for detecting the alignment of a pump end shaft is provided, the method comprising:
[0005] Acquire an image to be detected and input the image to be detected into a detection model; the image to be detected includes a pump end shaft and a connecting shaft connected to the pump end shaft.
[0006] The detection model is used to extract a first target feature; the first target feature includes the connection feature between the pump end shaft and the connecting shaft.
[0007] Based on the first target feature, first detection information is determined; wherein, the first detection information includes a first tag, the first tag indicating whether the pump end shaft head and the connecting shaft are aligned.
[0008] Optionally, after determining the first detection information, the method further includes:
[0009] The image to be detected is input into a classification model, and the connection deviation between the pump end shaft and the connecting shaft is determined by the classification model to obtain second detection information; wherein, the connection deviation includes angular deviation and / or distance deviation, the angular deviation indicates the angle between the axis of the pump end shaft and the axis of the connecting shaft, and the distance deviation indicates the distance between the center of the pump end shaft and the axis of the connecting shaft, and the second detection information includes a second label, the second label indicating whether the pump end shaft and the connecting shaft are aligned;
[0010] The first label and the second label are compared to determine whether they are consistent, and the third label is determined; wherein the third label indicates whether the pump end shaft head and the connecting shaft are aligned.
[0011] Optionally, the first detection information further includes detection frame information; wherein, the detection frame information includes the position information of the detection frame, and the detection frame includes the pump end shaft head and the connecting shaft in the image to be detected;
[0012] The step of inputting the image to be detected into the classification model to obtain the second detection information includes:
[0013] Based on the position information of the detection frame, the image to be detected is cropped to obtain a target area containing the pump end shaft head and the connecting shaft.
[0014] The target region is input into the classification model to obtain the second detection information.
[0015] Optionally, the step of comparing whether the first tag and the second tag are consistent to determine the third tag includes:
[0016] Determine whether the first label and the second label are consistent. If they are, determine that the third label is the first label. If not, input the image to be detected into the detection model and / or the classification model for training until the preset first iteration stopping condition is met.
[0017] Optionally, the connection features between the pump end shaft and the connecting shaft include at least one of the following: the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, and the rotation angle between the pump end shaft and the connecting shaft.
[0018] Optionally, the detection model is trained through the following steps:
[0019] Acquire multiple training images containing the pump end shaft and the connecting shaft; the training images contain preset labels, which indicate whether the pump end shaft and the connecting shaft are aligned;
[0020] The image to be trained is input into the model to be trained, so that the model to be trained can determine the fourth detection information of the image to be trained based on the extracted second target features; the fourth detection information includes a fourth label, which indicates whether the pump end shaft head and the connecting shaft are aligned;
[0021] The loss function is calculated based on the preset label and the fourth label, and the model parameters of the model to be trained are adjusted according to the loss function value until the preset second iteration stopping condition is met, thus obtaining the detection model.
[0022] Secondly, a detection system for aligning pump end shafts is provided, the detection system comprising:
[0023] An acquisition module is used to acquire an image to be detected and input the image to be detected into a detection model; the image to be detected includes a pump end shaft head and a connecting shaft connected to the pump end shaft head.
[0024] An extraction module is used to extract a first target feature through the detection model; the first target feature includes the connection feature between the pump end shaft and the connecting shaft;
[0025] The determining module is used to determine first detection information based on the first target feature; wherein the first detection information includes a first tag, the first tag indicating whether the pump end shaft head and the connecting shaft are aligned.
[0026] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein the processor executes the computer program to implement the detection method described in the first aspect.
[0027] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the detection method described in the first aspect.
[0028] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the detection method described in the first aspect.
[0029] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this application.
[0030] The aforementioned method, system, equipment, medium, and product for detecting pump end shaft alignment extracts the connection characteristics between the pump end shaft and the connecting shaft through a detection model. This efficiently and accurately detects whether the pump end shaft and the connecting shaft are aligned, improving the measurement accuracy of the pump end shaft and the connecting shaft, reducing alignment detection errors, and effectively enhancing the accuracy and reliability of alignment detection. Attached Figure Description
[0031] Figure 1 This is a first flowchart of a method for detecting the alignment of pump end shaft heads in one embodiment;
[0032] Figure 2 This is a schematic diagram of the training process of the detection model for a detection method for aligning pump end shafts in one embodiment;
[0033] Figure 3 This is a second flowchart of a detection method for aligning pump end shafts in one embodiment;
[0034] Figure 4 This is a schematic diagram of the detection system for aligning the pump end shaft in one embodiment;
[0035] Figure 5 This is a schematic diagram of the structure of an electronic device in one embodiment. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0037] It should be noted that the illustrations provided in this embodiment are only schematic representations of the basic concept of this application. Therefore, the drawings only show components relevant to this application and are not drawn according to the actual number, shape, and size of components in implementation. In actual implementation, the form, quantity, and proportion of each component can be arbitrarily changed, and the component layout may also be more complex. The structures, proportions, sizes, etc., shown in the accompanying drawings are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the implementation conditions of this application. Therefore, they have no substantial technical significance. Any modification to the structure, change in the proportional relationship, or adjustment of the size, without affecting the effect and purpose that this application can produce, should still fall within the scope of the technical content disclosed in this application. At the same time, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are only for clarity of description and are not intended to limit the scope of implementation of this application. Changes or adjustments in their relative relationships, without substantially changing the technical content, should also be considered within the scope of implementation of this application.
[0038] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the document does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0039] As illustrated herein, unless the context clearly indicates otherwise, the words “a,” “an,” “an,” and / or “the” do not specifically refer to the singular and may also include the plural. Generally speaking, the terms “comprising” and “including” only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0040] The definitions used herein, such as the terms “having,” “may have,” “comprising,” or “may include,” indicate the presence of the corresponding function, operation, element, etc., and do not limit the presence of one or more other functions, operations, elements, etc. Furthermore, it should be understood that the terms “comprising” or “having” as used herein indicate the presence of the features, figures, steps, operations, elements, components, or combinations thereof described in the specification, without excluding the presence or addition of one or more other features, figures, steps, operations, elements, components, or combinations thereof.
[0041] The prefixes such as "first" and "second" used in this application embodiment are merely for distinguishing different descriptive objects and do not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes used to distinguish descriptive objects in this application embodiment does not constitute a limitation on the described objects. The description of the described objects is given in the claims or the context of the embodiments, and should not constitute unnecessary restrictions due to the use of such prefixes. Furthermore, in the description of this embodiment, unless otherwise stated, "multiple" means two or more.
[0042] The alignment of the pump end shaft and the connecting shaft is crucial for the normal operation of a water pump. However, in traditional water pump assembly processes, the alignment problem between the pump end shaft and the connecting shaft is a common and serious quality control challenge. Any slight deviation can lead to abnormal wear, reduced efficiency, directly affecting the pump's performance and lifespan, and even causing premature equipment failure. Alignment refers to the alignment of the axis of the pump end shaft and the axis of the connecting shaft in all directions. In actual assembly, the alignment between the pump end shaft and the connecting shaft often relies on manual experience for adjustment and inspection. Manual alignment has certain limitations: it requires a lot of time and effort, has low production efficiency, cannot make precise adjustments for minor errors, and visual errors caused by worker fatigue over long periods are unavoidable. Especially when facing a large production load, the accuracy and consistency of inspection are difficult to guarantee.
[0043] Although tools such as laser alignment instruments have been introduced on some advanced assembly lines, the environmental conditions in which these tools are used are quite harsh. For example, changes in vibration and lighting conditions can affect the accuracy of measurements. At the same time, the high cost and complex operation of these tools limit their widespread application. In some small and medium-sized manufacturing industries, the application cost of these tools is too high, making it difficult to solve alignment problems in actual production. It is impossible to ensure high efficiency while guaranteeing high accuracy and reliability of alignment detection in complex production environments.
[0044] Based on this, this application provides a detection system for pump end shaft alignment, and a method for detecting pump end shaft alignment. By combining image detection algorithms and image classification algorithms, it automatically detects the alignment of the pump end shaft and the connecting shaft. It extracts the geometric features of the pump end shaft and the connection features between the pump end shaft and the connecting shaft to detect whether the pump end shaft and the connecting shaft are correctly aligned, providing a more efficient and accurate detection method. This solves the problems of low automation, low efficiency, and low accuracy in existing alignment detection technologies.
[0045] Figure 1 A method for detecting the alignment of a pump end shaft is provided as an exemplary embodiment of this application. The method includes:
[0046] S11. Obtain the image to be detected and input the image to be detected into the detection model.
[0047] The images to be detected include multiple images of the pump end shaft (which may be referred to as the pump head) and the connecting shaft, acquired from multiple angles.
[0048] The image to be detected can be uploaded from the detection system's Web User Interface (WUI). The detection system supports recognizing various patterns of the image to be detected and can upload different detection sources from the WebUI to obtain the image to be detected. For example, images can be obtained by directly inputting an image, extracting an image from a video, or extracting an image from a network camera. The format of the image to be detected can be JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), GIF (Graphics Interchange Format), BMP (Bitmap Image File), RAW (Raw Data Format), etc.
[0049] The detection system includes a web UI interface and a detection model. The detection model is started simultaneously with the web UI interface, and the detection sensitivity parameters and the detection source for the image to be detected are set. After acquiring the image to be detected through the web UI interface, the image is input into the detection model. By setting the sensitivity parameters, some detection results with low confidence can be filtered out, ensuring the accuracy and reliability of the detection model's output.
[0050] The detection model can be RetinaNet or Mask R-CNN.
[0051] S12. Extract the features of the first target using the detection model.
[0052] The first target feature may include the axis of the pump end shaft and the axis of the connecting shaft, and the connection features between the pump end shaft and the connecting shaft.
[0053] In one embodiment, the connection features between the pump end shaft and the connecting shaft include at least one of the following: the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, and the rotation angle between the pump end shaft and the connecting shaft.
[0054] Alignment refers to the state where the axis of the pump end shaft and the axis of the connecting shaft are aligned in all directions. However, when the pump end shaft and the connecting shaft are connected, they are not necessarily perfectly aligned. There may be radial distance deviations and / or axial angular deviations.
[0055] For example, if the axis of the pump end shaft is parallel but not coincident with the axis of the connecting shaft, a distance deviation exists. This distance deviation can be the perpendicular distance between the center of the pump end shaft and the axis of the connecting shaft. The center of the pump end shaft can be represented as the center of the circle at the connection surface between the pump end shaft and the connecting shaft, and the distance deviation is the perpendicular distance from the center of the circle to the axis of the connecting shaft. Distance deviation can occur if there is a distance between the center of the pump end shaft and the axis of the connecting shaft in any direction. In three-dimensional space, arbitrarily defined coordinate axes, including x, y, and z directions, are used. When there is a distance between the center of the pump end shaft and the axis of the connecting shaft in any direction, a distance deviation is considered to exist.
[0056] For example, the axis of the pump end shaft and the axis of the connecting shaft are not on the same straight line, but at a certain angle, which results in an angular deviation.
[0057] The alignment angle between the pump end shaft and the connecting shaft can be the angular deviation between the axis of the pump end shaft and the axis of the connecting shaft, or the included angle between the axis of the pump end shaft and the axis of the connecting shaft. The included angle between the axis of the pump end shaft and the axis of the connecting shaft can be either obtuse or acute.
[0058] The relative position of the pump end shaft and the connecting shaft can be considered as the positional relationship between the pump end shaft and the connecting shaft. The distance deviation between the pump end shaft and the connecting shaft can be considered as the distance between the axis of the pump end shaft and the axis of the connecting shaft. Distance deviation can occur if there is a distance between the axis of the pump end shaft and the axis of the connecting shaft in any direction. In three-dimensional space, coordinate axes can be arbitrarily set, including x, y, and z directions. A distance deviation is considered to exist when there is a distance between the axis of the pump end shaft and the axis of the connecting shaft in any direction.
[0059] The detection model can capture more key information from the connection features by extracting multiple connection features of the pump end shaft and the connecting shaft. By extracting the relative position, distance deviation, rotation angle, etc. between the two, the detection information of whether the pump end shaft and the connecting shaft are aligned can be obtained, which improves the measurement accuracy of the pump end shaft and the connecting shaft, reduces the error of alignment detection, and improves the accuracy of alignment detection.
[0060] The first target feature can be determined by the axis of the pump end shaft and the axis of the connecting shaft. For example, the axis of the pump end shaft and the axis of the connecting shaft can be determined first, and then the centering angle between the pump end shaft and the connecting shaft can be obtained through their axes. Alternatively, the axis of the pump end shaft and the axis of the connecting shaft can be determined first, and then the distance deviation between the pump end shaft and the connecting shaft can be obtained through their axes.
[0061] When training the detection model, the image to be trained can be labeled with a direction recognition symbol for the pump end shaft, enabling the trained detection model to identify the length direction of the pump end shaft. Therefore, the detection model can determine the axis of the pump end shaft in the following way: First, determine the length direction of the pump end shaft; then, determine at least two perpendicular lines to the length direction of the pump end shaft; next, determine the midpoints of the two perpendicular lines; finally, connect the two midpoints to obtain the axis of the pump end shaft (which can be called the central axis).
[0062] When training the detection model, the image to be trained can be labeled with a direction recognition symbol for the connecting axis, so that the trained detection model can recognize the length direction of the connecting axis. Therefore, the detection model can determine the axis of the connecting axis in the following way: first, determine the length direction of the connecting axis, then determine at least two perpendicular lines to the length direction of the connecting axis, then determine the midpoints of the two perpendicular lines respectively, and finally connect the two midpoints to obtain the axis of the connecting axis (which can be called the central axis).
[0063] After determining the axis of the pump end shaft and the axis of the connecting shaft, the connection characteristics between the pump end shaft and the connecting shaft can be determined. The positional deviation between the pump end shaft and the connecting shaft can be used as a criterion to determine whether the pump end shaft and the connecting shaft are aligned. This can avoid misjudgment of alignment caused by manufacturing accuracy errors of the shaft surface of the pump end shaft or the shaft surface of the connecting shaft.
[0064] In another embodiment, the first target feature may further include the geometric features of the pump end shaft. The geometric features of the pump end shaft include at least one of the following: the profile shape of the pump end shaft, and the end shape of the connecting shaft.
[0065] The design of pump end caps and connecting shafts typically varies depending on their application, working principle, and performance requirements. Identifying the contour shape of the pump end cap and the end shape of the connecting shaft, and extracting their specific geometric features, allows for the identification of pump end caps and connecting shafts of different shapes and types. By identifying different types of pump end caps and connecting shafts, it is possible to extract their specific geometric features for water pumps of different specifications, thereby improving the reliability and accuracy of alignment detection.
[0066] S13. Determine the first detection information based on the first target characteristics.
[0067] The first detection information includes a first label, the axis of the pump end shaft, and the axis of the connecting shaft. The first label indicates whether the pump end shaft and the connecting shaft are aligned.
[0068] After the detection model extracts the first target features, it determines the first detection information based on the first target features, and obtains information on whether the pump end shaft head and the connecting shaft are aligned.
[0069] In one embodiment, after determining the first detection information, a classification model can be used to detect the pump end shaft and the connecting shaft, and a second label can be used to verify the accuracy of the first label. Numerical analysis further verifies the accuracy of the first label output by the detection model, thereby improving the accuracy and reliability of the pump end shaft alignment detection. Specifically, the image to be detected can be input into the classification model, which determines the connection deviation between the pump end shaft and the connecting shaft to obtain the second detection information. The connection deviation includes angular deviation and / or distance deviation. When the pump end shaft and the connecting shaft are connected, their rotation center lines are not on the same straight line, resulting in an angle between their axes. The angular deviation indicates the angle between the axis of the pump end shaft and the axis of the connecting shaft. The distance deviation indicates the distance between the axis of the pump end shaft and the axis of the connecting shaft.
[0070] The second detection information includes a second label, which indicates whether the pump end shaft and the connecting shaft are aligned. A third label can be determined by comparing the first and second labels; the third label also indicates whether the pump end shaft and the connecting shaft are aligned.
[0071] The second label can be obtained by checking whether the connection deviation in the second detection information is less than the deviation threshold. The second label indicates whether the pump end shaft head and the connecting shaft are aligned.
[0072] The detection system also includes a classification model, which is started simultaneously with the launch of the Web UI. After acquiring the image to be detected, it can be input into the classification model. The classification model extracts the connection deviation between the pump end shaft and the connecting shaft, and can also extract the connection features between the pump end shaft and the connecting shaft, such as the angular deviation between the axis of the pump end shaft and the axis of the connecting shaft, or the distance between the center of the pump end shaft and the axis of the connecting shaft, to obtain the second detection information.
[0073] Furthermore, the classification model can determine the numerical value of the connection deviation and classify it into deviation types based on the numerical value. For example, if the angular deviation is determined to be 1°, connection deviations with an angular deviation of 1° are classified into one category. The classification results are displayed on the Web UI interface, and a second label is obtained based on the deviation type. If the connection deviation is greater than the deviation threshold, for example, if the angular deviation is 5° and the deviation threshold is 3°, the second label indicates that the pump end shaft and the connecting shaft are not accurately aligned. If the connection deviation is not greater than the deviation threshold, for example, if the angular deviation is 1° and the deviation threshold is 3°, the second label indicates that the pump end shaft and the connecting shaft are accurately aligned.
[0074] By comparing the first and second labels, a third label can be obtained. The alignment of the pump end shaft and connecting shaft in the third label is determined by judging whether the first target feature and the connection deviation meet preset alignment conditions. The alignment conditions can be set according to actual conditions; for example, the alignment conditions can be set as follows: the angular deviation in the connection deviation is no greater than 3°, and the distance deviation between the pump end shaft and the connecting shaft in the first target feature is no greater than 3mm. Obtaining the third label from both the first and second labels integrates the algorithm results of the detection and classification models, which can improve the accuracy and robustness of the detection system and reduce the possibility of judgment errors.
[0075] In one embodiment, determining the third label by comparing whether the first label and the second label are consistent includes:
[0076] Determine whether the first label and the second label are consistent. If they are, determine the third label as the first label. If not, input the image to be detected into the detection model and / or classification model for training until the preset first iteration stopping condition is met.
[0077] If the first and second labels are the same, both indicating that the pump end shaft and the connecting shaft are correctly aligned, then the third label indicates alignment, and the detection system outputs the third label; if the first and second labels are the same, both indicating that the pump end shaft is not aligned, then the third label indicates misalignment, and the detection system outputs the third label.
[0078] If the first label and the second label are inconsistent—for example, the first label indicates that the pump end shaft is aligned, while the second label indicates that the pump end shaft is not aligned—then the third label is inconsistent, indicating that the first label and the second label are inconsistent. In this case, it can be determined that at least one of the classification or detection models has produced a false alarm. The image to be detected is marked as a false alarm image, and its alignment can be reassessed. For example, the image to be detected can be displayed on the detection system's screen for further confirmation. If the image is confirmed to be aligned again, but the first label indicates misalignment while the second label indicates alignment, the false alarm image is used as a training sample and input into the detection model for training until a preset iteration stopping condition is met. If the image is confirmed to be misaligned again, but the first label indicates misalignment while the second label indicates alignment, the false alarm image is used as a training sample and input into the classification model for training until a preset iteration stopping condition is met.
[0079] The third label is derived by combining the first and second labels, integrating the algorithm results of the detection and classification models. This improves the accuracy and robustness of the detection system and reduces the possibility of misjudgments. Furthermore, a feedback mechanism is implemented, using false positive images to retrain the detection and classification models, enriching the training dataset and enhancing the model's robustness.
[0080] The preset first iteration stopping condition can be that the accuracy of the model output reaches the preset accuracy, or the value of the model's loss function converges to the preset value, or the number of iterations reaches the target number of iterations, or the recall of the model output reaches the preset recall. The preset accuracy, recall, preset value, and target number of iterations are determined according to the actual situation.
[0081] The classification model can be RBF (Radial Basis Function) or GPNN (General Regression Neural Network).
[0082] In one embodiment, in order to enable the classification model to accurately acquire the pump end shaft head and connecting shaft region in the image to be detected, and to avoid the classification model being interfered with by irrelevant information in the image to be detected other than the pump end shaft head and connecting shaft, thereby reducing the accuracy of the classification model, and to enable the classification model to focus on the effective information in the image to be detected, the first detection information may also include detection box information. The detection box information includes the position information of the detection box, and the detection box contains the pump end shaft head and connecting shaft in the image to be detected, which can reduce the interference of other irrelevant regions on the classification model.
[0083] The image to be detected is then input into the classification model to obtain the second detection information, including:
[0084] Based on the location information of the detection box, the image to be detected is cropped to obtain the target area containing the pump end shaft head and the connecting shaft.
[0085] The target region is input into the classification model to obtain the second detection information. The first detection information output by the detection model also includes detection box information, which contains the pump end shaft and connecting shaft in the image to be detected, as well as the axis of the pump end shaft and the axis of the connecting shaft. After the detection model outputs the detection box information, the detection system acquires the image to be detected and crops the region in the image corresponding to the position information of the detection box, thus obtaining the target region containing the pump end shaft and connecting shaft in the image to be detected. The target region is input into the classification model, which can extract the connection deviation between the pump end shaft and the connecting shaft in the target region based on the axis of the pump end shaft and the axis of the connecting shaft, and can also extract the connection features between the pump end shaft and the connecting shaft based on the axis of the pump end shaft and the axis of the connecting shaft, thus obtaining the second detection information. The second detection information includes a second label, which indicates whether the pump end shaft and the connecting shaft are aligned. After cropping the target area including the pump end shaft head and connecting shaft, the data is input into the classification model. This allows for accurate extraction and classification of the target area, reducing interference from other irrelevant areas and preventing the classification model from being affected by irrelevant information, thus improving its accuracy. This allows the classification model to focus on the effective information of the target area, thereby improving its accuracy and precision. Furthermore, it reduces the amount of data processed by the classification model, improving its computational efficiency.
[0086] The second detection information indicates whether the connection deviation is less than a deviation threshold. If the connection deviation is greater than the deviation threshold, for example, if the angular deviation in the connection deviation is 5° and the deviation threshold is 3°, then the second label in the second detection information indicates that the pump end shaft and the connecting shaft are not aligned. If the connection deviation is not greater than the deviation threshold, for example, if the angular deviation in the connection deviation is 1° and the deviation threshold is 3°, then the second label in the second detection information indicates that the pump end shaft and the connecting shaft are accurately aligned.
[0087] The process of cropping the image to be detected can be represented as follows:
[0088]
[0089] The image to be detected is I, and its size is H*W. The bounding box coordinates of the target region are (x1, y1) and (x2, y2). {·} This is an exponential function used to define the range of the target region.
[0090] In one embodiment, the detection model is trained through the following steps:
[0091] Acquire multiple training images containing the pump end shaft head and the connecting shaft; wherein, the training images contain preset labels, the preset labels indicating whether the pump end shaft head and the connecting shaft are aligned;
[0092] The image to be trained is input into the model to be trained, so that the model can determine the fourth detection information of the image to be trained based on the extracted second target features; wherein, the fourth detection information includes a fourth label, which indicates whether the pump end shaft head and the connecting shaft are correctly aligned;
[0093] The loss function is calculated based on the preset labels and the fourth label, and the model parameters of the model to be trained are adjusted according to the value of the loss function to optimize the recall and precision of the model during training, until the preset second iteration stopping condition is met, thus obtaining the detection model. Alternatively, the model's recall or precision can be incorporated into the loss function of the model to be trained as part of the optimization objective. By adjusting the weights in the loss function, the model can be made to focus more on improving recall or precision during training.
[0094] The training images include multiple original images of the pump end shaft and connecting shaft acquired from multiple angles, as well as false alarm images detected by the aforementioned detection system. The original images include images of the pump end shaft under ideal alignment and images of the pump end shaft under inaccurate alignment, to ensure that the model can learn various alignment states.
[0095] In addition to information on whether the pump end shaft and the connecting shaft are aligned, the centerline of the pump end shaft, and the centerline of the connecting shaft, the preset label also includes at least one of the following: the centerline of the pump end shaft, the centerline of the connecting shaft, the direction identification symbol of the pump end shaft, the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, the rotation angle between the pump end shaft and the connecting shaft, the outline shape of the pump end shaft, and the end shape of the connecting shaft.
[0096] In addition to information on whether the pump end shaft and the connecting shaft are aligned, the centerline of the pump end shaft, and the centerline of the connecting shaft, the fourth label also includes at least one of the following: the centerline of the pump end shaft, the centerline of the connecting shaft, the direction identification symbol of the pump end shaft, the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, the rotation angle between the pump end shaft and the connecting shaft, the outline shape of the pump end shaft, and the end shape of the connecting shaft.
[0097] The second target features include the geometric features of the pump end shaft head, and / or the connection features between the pump end shaft head and the connecting shaft. The geometric features of the pump end shaft head include at least one of the following: the profile shape of the pump end shaft head, and the end shape of the connecting shaft. The connection features between the pump end shaft head and the connecting shaft include at least one of the following: the alignment angle between the pump end shaft head and the connecting shaft, the relative position of the pump end shaft head and the connecting shaft, the distance deviation between the pump end shaft head and the connecting shaft, and the rotation angle between the pump end shaft head and the connecting shaft.
[0098] like Figure 2 As shown, before the image to be trained is input into the model, various preprocessing and enhancement operations can be performed on the image in the image processing module. These include not only pixel cropping, grayscale conversion, and resizing, but also complex image enhancement techniques such as Gaussian blurring and Gaussian noise reduction. To ensure accurate detection of the alignment between the pump end shaft and the connecting shaft, the image processing module can also extract features from the pump end shaft and the connecting shaft, including identifying key features such as the contour shape of the pump end shaft, the end shape of the connecting shaft, and the alignment angle between them. This can generate more diverse and specialized image datasets to improve the robustness and generalization ability of subsequent model training.
[0099] In the image processing module, to ensure accurate detection of the alignment between the pump end shaft and the connecting shaft, the feature extraction operation can be modeled using the following formula:
[0100] Extract the profile shape of the pump end shaft using the Hough Circle Transform:
[0101]
[0102] Where I(x,y) represents the pixel value of the image to be detected, (a,b) are the coordinates of the center of the circle, r is the radius, and δ(·) is the Dirac function.
[0103] The end shape characteristics of the connecting shaft are obtained by calculating the gradient direction field:
[0104]
[0105] Where G(x,y) is the gradient direction. and These are the gradients of the image in the y and x directions, respectively.
[0106] The alignment angle θ between the pump end shaft and the connecting shaft can be obtained by calculating the angle between their direction vectors:
[0107]
[0108] Among them, v pump and v shaft These are the direction vectors of the pump end shaft and the connecting shaft, respectively.
[0109] Random pixel cropping involves randomly selecting a rectangular region from the original training image and using it as the cropped image. Let the training image be I, with dimensions H*W, and the height and width of the cropping region be h. c *w c (where h) c ≤H,w c ≤W), the top left corner of the cropping area is randomly selected, denoted as (x c ,y c ), where x c ~Uniform(0,Ww c ), y c ~Uniform(0,Hh) c The Uniform() method represents sampling from a uniformly distributed random variable. The cropped image is then:
[0110] I crop =I[y c :y c +h c ,x c :x c +w c ];
[0111] If the training image is rotated by a random angle, assuming the rotation angle is θ, then θ ~ Uniform(θ) min ,θ max ); where θ min and θmax These are the minimum and maximum rotation angles, respectively, for example, θ. min -15°, θ max Image I after rotation by 15° rot This can be obtained by applying a rotation matrix to each pixel:
[0112]
[0113] Among them, (x rot ,y rot () are the pixel coordinates of the rotated image.
[0114] The size of the training images can also be randomly adjusted. Assuming the scaling ratio is s, then s ~ Uniform(s) min ,s max ), where s min and s max These are the minimum and maximum scaling ratios, for example, s. min It is 0.8, s max The value is 1.2, and the scaled image size is sH*sW.
[0115] A linear transformation is applied to the pixel values of the training image, and the brightness adjustment coefficient is set to β. Then β ~ Uniform(β) min ,β max ), where β min and β max These are the minimum brightness adjustment coefficient and the maximum brightness adjustment coefficient, respectively. The adjusted image is I. bright (x,y) = I(x,y) × β, where I(x,y) is the pixel value at coordinate (x,y) in the image to be trained.
[0116] Random Gaussian noise is introduced into the training images to improve the model's robustness to noise. The noise is set to have a mean of 0 and a standard deviation of σ, then σ ~ Uniform(σ min ,σ max The image after adding noise is: I noise (x,y)=I(x,y)+N(0,σ 2 ), where N(0,σ 2 ) indicates that the mean is 0 and the variance is σ. 2 Gaussian noise.
[0117] Random blurring is applied to the training images to reduce noise and details. The standard deviation of the Gaussian kernel is assumed to be σ. b Then σ b ~Uniform(σ b,min ,σ b,max The blurred image is in The standard deviation is represented by σ. b The Gaussian kernel, * denotes the convolution operation.
[0118] Random contrast adjustment is performed on the training image. Let the contrast adjustment coefficient be γ, then γ ~ Uniform(γ min ,γ max The adjusted image is I. contrast (x,y)=I(x,y) γ .
[0119] By randomly preprocessing images within a certain range, diverse image datasets can be generated, ensuring that each image has different variations. This can improve the robustness and generalization ability of the model under different environments and avoid the problem of overfitting.
[0120] The image processing module processes the image to be trained as described above and then inputs it into the training model. The training model extracts the second target feature, which is a key geometric feature in the image, especially a feature used to indicate the alignment of the pump end shaft and the connecting shaft during the assembly process. Based on the extracted second target feature, the training model determines the fourth detection information of the image to be trained. The fourth detection information includes a fourth label indicating whether the pump end shaft and the connecting shaft are aligned. The loss function is calculated based on the preset label and the fourth label, for example, by predicting the confidence of the fourth label. The loss function is then calculated based on the confidence of the fourth label and the confidence calculated from the preset label. The model parameters of the training model are adjusted based on the value of the loss function until a preset iteration stopping condition is met, thereby optimizing the recall and precision of the model during training to obtain a detection model. Alternatively, the recall or precision of the model can be incorporated into the loss function of the training model as part of the optimization objective. By adjusting the weights in the loss function, the training model can focus more on improving the recall or precision during training.
[0121] The preset first iteration stopping condition can be that the accuracy of the model output reaches the preset accuracy, or the value of the model's loss function converges to the preset value, or the number of iterations reaches the target number of iterations, or the recall of the model output reaches the preset recall. The preset accuracy, recall, preset value, and target number of iterations are determined according to the actual situation.
[0122] In one embodiment, after the model to be trained extracts the second target feature, weights can be assigned to the second target feature. For example, high-precision weights can be assigned to the relative position, rotation angle, and distance deviation of the pump end shaft and the connecting shaft to obtain the detection weights of the second target feature. The model to be trained is then trained based on the calculated detection weights. The detection model is optimized and trained for specific alignment states of the pump end shaft and the connecting shaft to ensure accurate identification of the alignment of the pump end shaft and the connecting shaft.
[0123] The training image, after being processed by the image processing module, can be input into the classification model for training. The classification model extracts the connection deviation between the pump end shaft and the connecting shaft, and determines the fifth detection information of the training image based on the connection deviation. The fifth detection information indicates whether the connection deviation is less than a deviation threshold. If the connection deviation is greater than the deviation threshold, the fifth label in the fifth detection information indicates that the pump end shaft and the connecting shaft are not aligned. If the connection deviation is not greater than the deviation threshold, the fifth label in the fifth detection information indicates that the pump end shaft and the connecting shaft are aligned.
[0124] The loss function of the classification model to be trained is calculated based on the preset label and the fifth label. For example, the confidence score of the fifth label is predicted. The loss function is calculated based on the confidence score of the fifth label and the confidence score calculated based on the preset label. The model parameters of the classification model are adjusted according to the loss function value until the preset second iteration stopping condition is met, and the trained classification model is obtained.
[0125] In one embodiment, after extracting connectivity biases from the training model of the classification model, these biases can be classified and weighted. By assigning different weights to different categories, the loss function can be improved to optimize the recall and precision of the training model during training. Alternatively, the recall or precision of the model can be incorporated into the loss function of the training model of the classification model as part of the optimization objective. By adjusting the weights in the loss function, the training model can focus more on improving recall or precision during training. The characteristics of the pump end shaft under different alignment conditions are learned to determine whether the pump end shaft is correctly installed, ensuring accurate classification and taking into account the specific alignment relationship between the pump end shaft and the connecting shaft.
[0126] The detection model and classification model work together to detect the alignment of the pump end shaft and the connecting shaft. With specific design and optimization, it can monitor and identify the alignment status of the pump end shaft and the connecting shaft during the pump assembly process, ensuring that the alignment status of the pump end shaft can be effectively identified and judged in complex environments, and accurately determining whether the pump end shaft is correctly aligned.
[0127] The following is combined Figure 3 The following is a further explanation of the detection method for the alignment of the pump end shaft:
[0128] The detection system includes a Web UI interface, a detection model, and a classification model. The detection model and classification model are started simultaneously with the Web UI interface. The detection sensitivity parameters of the detection model and the detection source of the image to be detected are set. After the image to be detected is acquired in the Web UI interface, it is input into the detection model. The detection model extracts the first target feature and the direction recognition symbol of the pump end shaft head, and determines the first detection information based on the first target feature to obtain information on whether the pump end shaft head (which can be called the pump head) is aligned with the connecting shaft.
[0129] The first detection information output by the detection model also includes detection box information. The detection box contains the pump end shaft and connecting shaft, as well as the axis of the pump end shaft and the axis of the connecting shaft in the image to be detected. After the detection model outputs the detection box information, the detection system acquires the image to be detected and crops the image based on the position information of the detection box. This yields the target region containing the pump end shaft and connecting shaft in the image to be detected. The target region is then input into the classification model. The classification model extracts the connection deviation between the pump end shaft and the connecting shaft based on their axes. It can also extract connection features between the pump end shaft and the connecting shaft based on their axes, such as the angular deviation between their axes or the distance between their centers. This yields the second detection information, which includes a second label indicating whether the pump end shaft and the connecting shaft are aligned. The classification model can also determine the numerical value of the connection deviation and classify it into deviation types based on the numerical value. For example, if the angular deviation is determined to be 1°, connection deviations with an angular deviation of 1° are classified into one category. The classification result is displayed on the Web UI interface, and a second label is obtained based on the deviation type. If the first label and the second label are the same, both indicating that the pump end shaft head is correctly aligned, then the third label is "correct alignment," and the detection system outputs the third label. If the first label and the second label are the same, both indicating that the pump end shaft head is not correctly aligned, then the third label is "incorrect alignment," and the detection system inputs the image to be detected and the third label into the alarm module for alarm prompt. If the first label and the second label are inconsistent, for example, the first label indicates that the pump end shaft head is correctly aligned, while the second label indicates that the pump end shaft head is not correctly aligned, then the image to be detected is marked as a false alarm image and used as a training sample to input into the detection model or classification model for training. The third detection information is obtained by combining the first label and the second label, and the algorithm results of the detection model and the classification model are integrated, which can improve the accuracy and robustness of the detection system and reduce the possibility of judgment errors. Furthermore, a feedback mechanism was set up to reuse false positive images for training the detection and classification models, enriching the training sample dataset and improving the robustness of the models.
[0130] The pump end shaft alignment detection method provided in this application is applied to a pump end shaft alignment detection system. This system integrates a detection module, an image processing module, a classification module, a classification result display module, and an alarm module, forming a complete closed-loop system. It is easy to integrate and expand, and supports the recognition of various image patterns, making it suitable for pump products of different specifications. This application provides a more efficient, accurate, and flexible detection system, significantly improving the detection of misalignment between the pump end shaft and the connecting shaft. It solves the problems of low automation, low efficiency, and low accuracy in existing alignment detection technologies.
[0131] It should be understood that, although Figure 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0132] like Figure 4 As shown, this application also provides a detection system for aligning pump end shafts, the detection system comprising:
[0133] Acquisition module 41 is used to acquire the image to be detected and input the image to be detected into the detection model; the image to be detected includes a pump end shaft head and a connecting shaft connected to the pump end shaft head;
[0134] Extraction module 42 is used to extract a first target feature through the detection model; the first target feature includes the connection feature between the pump end shaft and the connecting shaft;
[0135] The determining module 43 is used to determine first detection information based on the first target feature; wherein the first detection information includes a first tag, the first tag indicating whether the pump end shaft head and the connecting shaft are aligned.
[0136] In one embodiment, the determining module is further configured to:
[0137] The image to be detected is input into a classification model, and the connection deviation between the pump end shaft and the connecting shaft is determined by the classification model to obtain second detection information; wherein, the connection deviation includes angular deviation and / or distance deviation, the angular deviation indicating the angle between the axis of the pump end shaft and the axis of the connecting shaft, and the distance deviation indicating the distance between the center of the pump end shaft and the axis of the connecting shaft; the second detection information includes a second label, the second label indicating whether the pump end shaft and the connecting shaft are aligned;
[0138] The first label and the second label are compared to determine whether they are consistent, and the third label is determined; wherein the third label indicates whether the pump end shaft head and the connecting shaft are aligned.
[0139] In one embodiment, the first detection information further includes detection frame information; wherein, the detection frame information includes the position information of the detection frame, and the detection frame includes the pump end shaft head and the connecting shaft in the image to be detected;
[0140] The determination module is also used for:
[0141] Based on the position information of the detection frame, the image to be detected is cropped to obtain a target area containing the pump end shaft head and the connecting shaft.
[0142] The target region is input into the classification model to obtain the second detection information.
[0143] In one embodiment, the determining module is further configured to:
[0144] Determine whether the first label and the second label are consistent. If they are, determine that the third label is the first label. If not, input the image to be detected as a training sample into the detection model and / or the classification model for training until the preset first iteration stopping condition is met.
[0145] Optionally, the connection features between the pump end shaft and the connecting shaft include at least one of the following: the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, and the rotation angle between the pump end shaft and the connecting shaft.
[0146] Optionally, the detection model is trained through the following steps:
[0147] Acquire multiple training images containing the pump end shaft and the connecting shaft; the training images contain preset labels, which indicate whether the pump end shaft and the connecting shaft are aligned;
[0148] The image to be trained is input into the model to be trained, so that the model to be trained can determine the fourth detection information of the image to be trained based on the extracted second target features; the fourth detection information includes a fourth label, which indicates whether the pump end shaft head and the connecting shaft are aligned;
[0149] The loss function is calculated based on the preset label and the fourth label, and the model parameters of the model to be trained are adjusted according to the loss function value until the preset second iteration stopping condition is met, thus obtaining the detection model.
[0150] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs.
[0151] Figure 5 This is a schematic diagram of the structure of an electronic device according to an example embodiment of this application. The electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor. When the processor executes the computer program, it implements the detection method for pump end shaft alignment described in any of the above embodiments. Figure 5 The electronic device 50 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0152] like Figure 5 As shown, the electronic device 50 can be manifested in the form of a general-purpose computing device, such as a server device. The components of the electronic device 50 may include, but are not limited to: at least one processor 51, at least one memory 52, and a bus 53 connecting different system components (including memory 52 and processor 51).
[0153] Bus 53 includes a data bus, an address bus, and a control bus.
[0154] The memory 52 may include volatile memory, such as random access memory (RAM) 521 and / or cache memory 522, and may further include read-only memory (ROM) 523.
[0155] The memory 52 may also include a program tool 525 (or utility) having a set (at least one) program module 524, such program module 524 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0156] The processor 51 executes various functional applications and data processing by running computer programs stored in the memory 52, such as the pump end shaft alignment detection method provided in any of the above embodiments.
[0157] Electronic device 50 can also communicate with one or more external devices 54 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 55. Furthermore, electronic device 50 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 56. As shown, network adapter 56 communicates with other modules of electronic device 50 via bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 50, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0158] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0159] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the pump end shaft alignment detection method provided in any of the above embodiments.
[0160] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0161] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the pump end shaft alignment detection method described in any of the above claims.
[0162] The program code for executing the computer program product of this application can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.
[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0164] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting the alignment of a pump end shaft, characterized in that, The detection method includes: Acquire an image to be detected and input the image to be detected into a detection model; the image to be detected includes a pump end shaft and a connecting shaft connected to the pump end shaft. The detection model is used to extract a first target feature; the first target feature includes the connection feature between the pump end shaft and the connecting shaft. Based on the first target feature, first detection information is determined; wherein, the first detection information includes a first tag, the first tag indicating whether the pump end shaft head and the connecting shaft are aligned.
2. The detection method as described in claim 1, characterized in that, After determining the first detection information, the method further includes: The image to be detected is input into a classification model, and the connection deviation between the pump end shaft and the connecting shaft is determined by the classification model to obtain second detection information; wherein, the connection deviation includes angular deviation and / or distance deviation, the angular deviation indicates the angle between the axis of the pump end shaft and the axis of the connecting shaft, and the distance deviation indicates the distance between the center of the pump end shaft and the axis of the connecting shaft, and the second detection information includes a second label, the second label indicating whether the pump end shaft and the connecting shaft are aligned; The first label and the second label are compared to determine whether they are consistent, and the third label is determined; wherein the third label indicates whether the pump end shaft head and the connecting shaft are aligned.
3. The detection method as described in claim 2, characterized in that, The first detection information further includes detection frame information; wherein, the detection frame information includes the position information of the detection frame, and the detection frame includes the pump end shaft head and the connecting shaft in the image to be detected; The step of inputting the image to be detected into the classification model to obtain the second detection information includes: Based on the position information of the detection frame, the image to be detected is cropped to obtain a target area containing the pump end shaft head and the connecting shaft. The target region is input into the classification model to obtain the second detection information.
4. The detection method as described in claim 2, characterized in that, The step of comparing whether the first tag and the second tag are consistent to determine the third tag includes: Determine whether the first label and the second label are consistent. If they are, determine that the third label is the first label. If not, input the image to be detected into the detection model and / or the classification model for training until the preset first iteration stopping condition is met.
5. The detection method according to any one of claims 1-4, characterized in that, The connection features between the pump end shaft and the connecting shaft include at least one of the following: the alignment angle between the pump end shaft and the connecting shaft, the relative position of the pump end shaft and the connecting shaft, the distance deviation between the pump end shaft and the connecting shaft, and the rotation angle between the pump end shaft and the connecting shaft.
6. The detection method according to any one of claims 1-4, characterized in that, The detection model is trained through the following steps: Acquire multiple training images containing the pump end shaft and the connecting shaft; the training images contain preset labels, which indicate whether the pump end shaft and the connecting shaft are aligned; The image to be trained is input into the model to be trained, so that the model to be trained can determine the fourth detection information of the image to be trained based on the extracted second target features; The fourth detection information includes a fourth label, which indicates whether the pump end shaft head and the connecting shaft are aligned. The loss function is calculated based on the preset label and the fourth label, and the model parameters of the model to be trained are adjusted according to the loss function value until the preset second iteration stopping condition is met, thus obtaining the detection model.
7. A detection system for aligning pump end shafts, characterized in that, The detection system includes: An acquisition module is used to acquire an image to be detected and input the image to be detected into a detection model; the image to be detected includes a pump end shaft head and a connecting shaft connected to the pump end shaft head. An extraction module is used to extract a first target feature through the detection model; the first target feature includes the connection feature between the pump end shaft and the connecting shaft; The determining module is used to determine first detection information based on the first target feature; wherein the first detection information includes a first tag, the first tag indicating whether the pump end shaft head and the connecting shaft are aligned.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes the computer program, it implements the detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the detection method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the detection method as described in any one of claims 1 to 6.