Component detection methods, devices, equipment and media

By segmenting and classifying the images to be detected, the shape and area of ​​the component distribution area are automatically identified, and the problem of low accuracy caused by the dependence of manual observation in the prior art is solved, and the automation and scale of component detection is realized. application.

CN113762075BActive Publication Date: 2024-11-26BEIJING KUANGSHI TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110867219.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-29
Publication Date
2024-11-26
Estimated Expiration
2041-07-29

AI Technical Summary

Technical Problem

In the prior art, component detection relies on manual observation, resulting in low accuracy and inability to achieve large-scale applications.

Method used

By segmenting and classifying the image to be detected, the morphology and area of ​​the component distribution area are automatically identified, and the component distribution category is determined using the trained model, thereby achieving automation of component detection.

Benefits of technology

It improves the accuracy and stability of component detection, reduces labor costs, and realizes the large-scale application of component detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762075B_ABST
    Figure CN113762075B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a component detection method, device, equipment and medium, which belong to the field of image processing technology and aim to realize large-scale application of component detection and improve the accuracy of component detection. The method comprises: obtaining an image to be detected, wherein the image to be detected comprises multiple component distribution areas; segmenting the image to be detected to obtain segmented areas corresponding to each of the multiple component distribution areas; classifying the segmented areas corresponding to each of the multiple component distribution areas to obtain component distribution categories corresponding to each of the multiple component distribution areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a component detection method, device, equipment and medium. Background Art

[0002] In some practical needs, it is often necessary to assess the quality level of an object used in industrial operations or the level of the process for manufacturing the object based on the content and form of a certain component contained in the object. Therefore, it is necessary to detect the content and form of the components contained in the object. This test is called component detection. Taking the spheroidization level of ductile iron as an example, it is necessary to determine the quality level of ductile iron by detecting the spheroidization rate of the graphite component in the ductile iron.

[0003] The component detection method used in related technologies is generally to take an image of the object containing the components, and then use the naked eye to observe the shape, size and other attributes of the target components to determine the quality grade of the object. However, this method, on the one hand, has limited human resources and cannot achieve large-scale application of component detection; on the other hand, the determination of quality grade is heavily dependent on human experience, resulting in low accuracy of component detection.

[0004] Therefore, how to improve the accuracy of component detection and enable large-scale application of component detection has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of the above problems, a component detection method, device, equipment and medium are proposed in the embodiments of the present application to overcome the above problems or at least partially solve the above problems.

[0006] In order to solve the above problems, the first aspect of the present application discloses a component detection method, the method comprising:

[0007] Obtaining an image to be detected, wherein the image to be detected includes a plurality of component distribution areas;

[0008] Segmenting the image to be detected to obtain segmented areas corresponding to each of the plurality of component distribution areas;

[0009] The segmented areas corresponding to each of the plurality of component distribution areas are classified to obtain the component distribution categories corresponding to each of the plurality of component distribution areas.

[0010] Optionally, after obtaining the component distribution categories corresponding to each of the plurality of component distribution areas, the method further comprises:

[0011] According to multiple target categories, the distribution areas corresponding to the component distribution categories belonging to the same target category are clustered to determine the number of component distribution areas of each target category, wherein the multiple target categories respectively represent different distribution states of the component distribution areas;

[0012] The rank of the components is determined based on the number of component distribution areas for each target category.

[0013] Optionally, segmenting the image to be detected to obtain segmented areas corresponding to each of the multiple component distribution areas, and classifying the segmented areas corresponding to each of the multiple component distribution areas to obtain component distribution categories corresponding to each of the multiple component distribution areas, including:

[0014] Inputting the image to be detected into a component detection model, dividing the multiple component distribution areas by the component detection model to obtain segmented areas corresponding to the multiple component distribution areas, and classifying the segmented areas corresponding to the multiple component distribution areas;

[0015] Obtaining component distribution categories corresponding to each of the plurality of component distribution areas output by the component detection model;

[0016] The component detection model is trained using sample images marked with component distribution areas and corresponding target categories.

[0017] Optionally, segmenting the image to be detected to obtain segmented areas corresponding to each of the plurality of component distribution areas comprises:

[0018] Inputting the image to be detected into a segmentation model to obtain segmentation regions corresponding to each of the plurality of component distribution regions, wherein the segmentation model is trained using sample images marked with component distribution regions;

[0019] Classifying the segmented areas corresponding to the plurality of component distribution areas to obtain component distribution categories corresponding to the plurality of component distribution areas, including:

[0020] The segmented areas corresponding to each of the multiple component distribution areas are input into a classification model to obtain component distribution categories corresponding to each of the multiple component distribution areas, wherein the classification model is trained using sample images marked with target categories corresponding to the component distribution areas.

[0021] Optionally, classifying the segmented areas corresponding to the plurality of component distribution areas to obtain component distribution categories corresponding to the plurality of component distribution areas includes:

[0022] The component distribution categories corresponding to each of the plurality of component distribution areas are determined according to the sizes of the segmented areas corresponding to each of the plurality of component distribution areas.

[0023] Optionally, determining the component distribution category corresponding to each of the plurality of component distribution areas according to the size of the segmented area corresponding to each of the plurality of component distribution areas comprises:

[0024] Determine the area of ​​each of the plurality of component distribution regions according to the total number of pixels included in the segmented regions corresponding to each of the plurality of component distribution regions;

[0025] The component distribution categories corresponding to each of the plurality of component distribution regions are determined according to the respective areas of the plurality of component distribution regions.

[0026] Optionally, optionally, obtaining the component distribution categories corresponding to each of the plurality of component distribution regions according to the respective areas of the plurality of component distribution regions comprises:

[0027] Inputting the ratio of the area of ​​each of the plurality of component distribution regions to the area of ​​the image to be detected into a classification model to obtain the component distribution category corresponding to each of the plurality of component distribution regions;

[0028] The classification model is trained using sample images marked with target categories and target ratios corresponding to component distribution regions, wherein the target ratio is the ratio of the area of ​​the component distribution region to the area of ​​the sample image.

[0029] Optionally, obtaining an image to be detected includes:

[0030] Performing microscopic photography on a target object containing the component, and determining an image obtained by performing microscopic photography on the target object as the image to be detected;

[0031] Or, an image to be detected outputted by a microscopic imaging device after microscopic imaging of the target object is obtained.

[0032] According to a second aspect of the present application, a component detection device is provided, the device comprising:

[0033] An image acquisition module, used for acquiring an image to be detected, wherein the image to be detected includes a plurality of component distribution areas;

[0034] An image segmentation module, used for segmenting the image to be detected to obtain segmented areas corresponding to each of the plurality of component distribution areas;

[0035] The category determination module is used to classify the segmented areas corresponding to each of the multiple component distribution areas to obtain the component distribution categories corresponding to each of the multiple component distribution areas.

[0036] The third aspect of the embodiments of the present application further discloses an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes, the component detection method as described in the embodiments of the first aspect is implemented.

[0037] The fourth aspect of the embodiments of the present application further discloses a computer-readable storage medium, which stores a computer program that enables a processor to execute the component detection method as described in the embodiments of the first aspect of the present application.

[0038] The embodiments of the present application include the following advantages:

[0039] In an embodiment of the present application, an image to be detected including multiple component distribution areas can be obtained, and the multiple component distribution areas in the image to be detected can be segmented to obtain segmented areas corresponding to each of the multiple component distribution areas, and then the multiple segmented areas can be classified to obtain component distribution categories corresponding to each of the multiple component distribution areas. In an embodiment of the present application, the component distribution categories of the multiple component distribution areas where the components are distributed in the object can be automatically obtained by segmenting the image to be detected and then classifying it. Among them, a component distribution area can represent a position area of ​​the component in the object. Since in component detection, the component detection is generally performed by the shape, size and other attributes of the component, in this way, after obtaining the component distribution categories of each of the multiple distribution areas, the distribution characteristics of the component in the object can be obtained, thereby realizing automated component detection.

[0040] On the one hand, since automated component detection is achieved, there is no need to invest too much manpower cost, so the component detection method of the embodiment of the present application can be applied on a large scale with low manpower cost. On the other hand, since the present application can accurately obtain the component distribution categories corresponding to each of the multiple component distribution areas through a series of processing of the image to be detected, the stability of the detection accuracy is improved, avoiding the problem of unreliable component detection results due to differences in worker experience during manual detection, thereby improving the accuracy of component detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 is a flowchart of the steps of the component detection method in the embodiment of the present application;

[0043] Figure 2 is an exemplary image of ductile iron in an embodiment of the present application;

[0044] Figure 3 It is a schematic diagram of the principle of using a neural network model to perform component detection in an embodiment of the present application;

[0045] Figure 4 It is another schematic diagram of the principle of using a neural network model to perform component detection in an embodiment of the present application;

[0046] Figure 5 It is a structural block diagram of a component detection device in an embodiment of the present application;

[0047] Figure 6 It is a structural block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] Component testing is mainly used to evaluate the quality of an object containing a certain component. Taking ductile iron as an example, the quality of ductile iron needs to be evaluated based on the spheroidization rate of graphite in ductile iron. Among them, the detection of the spheroidization rate of graphite in ductile iron can be considered as a component detection, and the component detected is graphite.

[0050] In the related art, taking ductile iron as an example, an image of ductile iron is generally taken, and the image may include multiple distribution areas of graphite, that is, the image can be understood as an image reflecting the distribution of graphite in ductile iron, and the image can reflect the form of graphite in ductile iron. In practice, the forms of graphite in ductile iron include spherical, flaky, flocculent, and worm-like. Generally, workers estimate the spheroidization rate of graphite by observing the proportion of each form of graphite in the distribution image. However, this manual observation method is not reliable and cannot be applied on a large scale.

[0051] Of course, the above only uses ductile iron as an example to illustrate the limitations of component detection in related technologies. The above problems also exist for other scenarios that require manual component detection.

[0052] In view of this, the present application proposes the following technical concept: by performing image segmentation on an image to be detected including multiple component distribution areas, the component distribution area is separated out separately as a segmented area, and the segmented area can be understood as a separate segmented image. Afterwards, by identifying the segmented areas of each of the multiple component distribution areas, the component distribution categories corresponding to each of the multiple component distribution areas are determined, thereby achieving the technical purpose of automated component detection, so that the component detection method of the embodiment of the present application is applied on a large scale, wherein, through a series of processing of the image to be detected, the component distribution categories corresponding to each of the multiple component distribution areas can be accurately obtained, so that the stability of the detection accuracy is improved, thereby avoiding the problem of low component detection accuracy due to differences in worker experience during manual detection.

[0053] Reference Figure 1 As shown, a flowchart of the component detection method of an embodiment of the present application is shown, which can be specifically applied to a smart terminal, and of course can also be applied to a server. The smart terminal can be, for example, a computer, a mobile phone, or a tablet, and can specifically include the following steps:

[0054] Step S101: obtaining an image to be detected, wherein the image to be detected includes a plurality of component distribution areas.

[0055] In this embodiment, the multiple component distribution areas included in the image to be detected may all point to the same component, for example, all point to a component whose component is graphite. That is, the image to be detected in the present application may include multiple component distribution areas whose components are target components. Among them, the multiple component distribution areas may have different shapes, for example, the shapes of some component distribution areas are circular, the shapes of some component distribution areas are strip-shaped, and the shapes of other component distribution areas are irregular.

[0056] It should be understood that the above morphology of the component distribution area is only an exemplary description for ease of understanding and does not represent a specific limitation on the embodiments of the present application. In practice, the morphology of the component distribution area is different depending on the component to be detected.

[0057] For example, refer to Figure 2 As shown, Figure 2 is an exemplary image of ductile iron, wherein a plurality of black regions refer to the distribution areas of graphite, such as Figure 2 As shown, the multiple distribution areas of graphite include: a distribution area with a shape approximately circular, a distribution area with a shape approximately worm-like, and a distribution area with a shape approximately flake-like. These distribution areas with different shapes can reflect the different states of graphite in ductile iron.

[0058] Step S102: segmenting the image to be detected to obtain segmented areas corresponding to each of the plurality of component distribution areas.

[0059] In this embodiment, multiple component distribution areas of the same component can be separated from the image to be detected, thereby obtaining multiple segmented areas, each of which can correspond to a component distribution area. For example, a component distribution area can correspond to an aggregation area of ​​graphite molecules. In practice, multiple component distribution areas of the same component can be separated using image segmentation technology.

[0060] In specific implementation, the position of each component distribution area where the target component is located can be determined first, and then each component distribution area can be extracted into a segmented area according to the position of each component distribution area.

[0061] Step S103: classifying the segmented areas corresponding to each of the plurality of component distribution areas to obtain the component distribution categories corresponding to each of the plurality of component distribution areas.

[0062] In this embodiment, since distribution areas of different shapes can reflect different states of components in an object, for example, taking ductile iron as an example, different states of graphite in ductile iron can be reflected. For another example, taking biological tissues infected by viruses or bacteria as an example, biological tissues with different degrees of infection may present different colors or different shapes. Therefore, in this application, the component distribution category may refer to the shape category, color depth category, or component density distribution category of the component distribution area.

[0063] In practice, when detecting components, the components are judged based on their distribution patterns in the object. Therefore, the segmented areas corresponding to each of the multiple component distribution areas can be classified. Specifically, the multiple component distribution areas can be classified according to their respective patterns, and the segmented areas corresponding to the component distribution areas with similar or identical patterns can be classified into one category, and then the characteristics of the pattern presented by the segmented areas under each category can be determined. In specific implementation, it is to determine whether the pattern presented by the segmented areas under each category belongs to the preset pattern. In this way, the component distribution categories corresponding to each of the multiple component distribution areas can be obtained.

[0064] For example, taking ductile iron as an example, among the multiple distribution areas of graphite in ductile iron, the segmented areas with the same or similar shapes can be grouped together, and then it is determined whether the shape of the segmented areas in each group belongs to the category of spherical, flaky, floc-like, or worm-like. In this way, the component distribution category of each segmented area can be obtained.

[0065] After obtaining the component distribution categories corresponding to multiple component distribution areas, the number of component distribution areas under each category can be obtained. In this way, the distribution difference of the components in the object can be determined by counting the number of component distribution areas in each component distribution category, and the quality grade of the object can be evaluated based on the distribution difference.

[0066] For example, taking ductile iron as an example, assuming that the number of component distribution areas of the component distribution category is 3 for the spherical category, 4 for the lumpy category, 2 for the flocculent category, and 1 for the worm category, the spheroidization level of the ductile iron can be determined based on the ratio of the weighted sum of the number of component distribution areas of each category to the total number of component distribution areas. If the ratio of the weighted sum of the number of component distribution areas of each category to the total number of component distribution areas is 0.77, the spheroidization level of the ductile iron can be determined to be level 4.

[0067] By adopting the technical solution of the embodiment of the present application, since the component distribution categories of the multiple distribution areas where the components in the object are distributed can be automatically obtained by segmenting and classifying the image to be detected, wherein a component distribution area can characterize an area where the component is located in the object, since in component detection, the component detection is generally performed by the shape, size and other attributes of the component, so, after obtaining the component distribution categories of the multiple distribution areas, the distribution characteristics of the component in the object can be obtained, thereby realizing automated component detection. On the one hand, since automated component detection is realized, the component detection method of the embodiment of the present application can be applied on a large scale, on the other hand, since the present application can accurately obtain the component distribution categories corresponding to each of the multiple component distribution areas through a series of processing of the image to be detected, the stability of the detection accuracy is improved, thereby avoiding the problem of unreliable results caused by differences in workers' experience during manual detection, thereby improving the accuracy of component detection.

[0068] In some embodiments, the image to be detected can be a microscopic image. In this case, on the first aspect, the intelligent terminal can be a terminal with a microscopic camera function, which can perform microscopic photography of a target object containing the component; and the image obtained by performing microscopic photography of the target object is determined as the image to be detected. On the second aspect, the intelligent terminal can be connected to a microscopic camera device, and then obtain the image to be detected output by the microscopic camera device after performing microscopic photography of the target object containing the component. Specifically, the intelligent terminal can be connected to the microscopic camera device by wired or wireless communication, so as to obtain the image to be detected sent by the microscopic camera device.

[0069] In this embodiment, when the intelligent terminal is a terminal with a microscope camera function, the intelligent terminal can be an electron microscope with an integrated processor. After taking the image to be detected, the electron microscope can send the image to be detected to the processor through the internal circuit, so that the processor processes the image to be detected, thereby obtaining the component detection result.

[0070] When the smart terminal can obtain the image to be detected by the microscope camera device, the smart terminal can be a mobile phone, a computer, a tablet, a server, etc. In this way, the smart terminal can establish communication with the microscope camera device to obtain the image to be detected taken by the microscope camera device.

[0071] In the case where the above-mentioned component detection method is applied to a server, at least one microscopic camera device can be integrated in the server, and each microscopic camera device is used to capture the image to be detected, and then the server can obtain the image to be detected sent by the electronic microscopic camera device through an internal circuit. Alternatively, the server can be connected to the microscopic camera device to obtain the image to be detected output by the microscopic camera device after microscopically photographing the target object containing the component. Specifically, the server can establish communication with the microscopic camera device to obtain the image to be detected sent by the microscopic camera device.

[0072] Among them, when multiple microscopic camera devices are integrated in the server or connected to multiple microscopic camera devices, and multiple microscopic camera devices are used to capture images of different types of components to be detected, the server can obtain the images to be detected sent by multiple microscopic camera devices. In this way, the powerful data processing capability of the server can be utilized to achieve the purpose of component detection of multiple components at the same time. In this way, large-scale component detection can be achieved and the efficiency of component detection can be improved.

[0073] In some scenarios, it may be necessary to perform component detection at a more microscopic level. For example, in some cytology fields, it is necessary to detect the distribution of a certain cell in a tissue to assess the quality grade of the tissue, or it is necessary to detect the distribution of a certain organic or inorganic component in an object to assess the quality grade of the object. However, the distribution of cells, organic or inorganic components in the corresponding tissues and objects cannot generally be observed directly with the naked eye and requires microscopic photography to be determined. Therefore, to adapt to this scenario, the target object containing the components can be photographed microscopically to obtain the image to be detected, where the target object can be either a tissue or an object.

[0074] For example, still taking ductile iron as an example, the spheroidization rate of graphite in ductile iron is generally not observable with the naked eye. Therefore, it is necessary to perform microscopic photography on slices of ductile iron, so as to obtain an image of the distribution morphology of graphite in the ductile iron.

[0075] In this case, in the implementation of the second aspect, the microscopic imaging device may be an electron microscope. The smart terminal may obtain the image to be detected by: the smart terminal is connected to the electron microscope for communication, so that when the electron microscope captures a microscopic image of a target object containing a component, the microscopic image may be sent to the smart terminal, and the smart terminal uses the microscopic image as the image to be detected to start processing the image to be detected.

[0076] Of course, in practice, the user can also collect microscopic images of the target object containing the components taken by the electron microscope, and then upload them to the smart terminal. The specific method of obtaining the image to be detected can be set according to actual needs, and this application does not limit this.

[0077] When this implementation is adopted, the method of the present application can be improved to be applicable to the detection of some components that cannot be observed by the naked eye and cannot be photographed by an ordinary camera, so that the present application can be applied to the quality grade assessment of microscopic substances, thereby broadening the scope of application of the present application.

[0078] In some embodiments, the component distribution category to which each component distribution area belongs can be determined based on the shape, size, proportion, etc. of the multiple component distribution areas of the component. Therefore, the component distribution category corresponding to each of the multiple component distribution areas can be obtained in the following manner. Specifically, the component distribution category corresponding to each of the multiple component distribution areas can be determined based on the size and / or shape of the segmented area corresponding to each of the multiple component distribution areas.

[0079] In specific implementation, the component distribution categories corresponding to the multiple component distribution areas can be determined based on the sizes of the segmented areas corresponding to the multiple component distribution areas, and the sizes of the segmented areas can be understood as the areas of the segmented areas. Of course, the component distribution categories corresponding to the multiple component distribution areas can also be determined based on the shapes of the segmented areas corresponding to the multiple component distribution areas, and the shapes of the segmented areas can be, but are not limited to, spherical, sheet-like, floc-like, and worm-like.

[0080] Of course, in practice, the component distribution categories corresponding to the multiple component distribution areas can be determined by combining the sizes and shapes of the segmented areas corresponding to the multiple component distribution areas. In this case, segmented areas with similar shapes and sizes can be classified into one category, so that a finer-grained classification can be achieved. For example, segmented areas with the same spherical shape and area S1 are classified into one category, and segmented areas with the same spherical shape and area S2 are classified into another category.

[0081] Among them, when determining the component distribution category corresponding to each of the multiple component distribution areas according to the size of the segmented area corresponding to each of the multiple component distribution areas, the area of ​​each of the multiple component distribution areas can be determined according to the total number of pixels included in the segmented area corresponding to each of the multiple component distribution areas, and then the component distribution category corresponding to each of the multiple component distribution areas can be obtained according to the ratio of the area of ​​each of the multiple component distribution areas to the area of ​​the image to be detected.

[0082] In some scenarios, the quality level of the object can be evaluated based on the area occupied by the component distribution area in the image to be detected. For example, in the evaluation of the degree of infiltration of some components into the object, the size of the area occupied by the component distribution area in the image to be detected can characterize the degree of infiltration of the component into the object. In this way, the ratio of the area of ​​each component distribution area to the area of ​​the image to be detected can be determined, and this ratio can characterize the degree of infiltration of the component into the object. For another example, in the evaluation of the content of some components in an object, it is necessary to determine the volume content of the component in the object. In this way, it is also necessary to determine the component distribution category of each component distribution area through the area of ​​the component distribution area. In some cases, the component distribution category of the component distribution area can also characterize the volume content of the component in the object.

[0083] During specific implementation, multiple categories can be pre-set, and different categories correspond to different ratios of the area of ​​component distribution areas to the area of ​​the image to be detected. Thus, the component distribution category of each component distribution area can be determined according to the ratio of the area of ​​each component distribution area to the area of ​​the image to be detected. Accordingly, the category can also characterize the degree of infiltration of the component in the object or the volume content in the object.

[0084] Among them, since the segmented area is composed of pixel points, the area of ​​the component distribution area can be determined according to the total number of pixel points included in the segmented area corresponding to the component distribution area. When determining the ratio of the area of ​​the component distribution area to the area of ​​the image to be detected, the area of ​​the image to be detected can be determined according to the total number of pixel points included in the image to be detected.

[0085] For example, still taking ductile iron as an example, graphite in ductile iron includes multiple graphite distribution areas, and one graphite distribution area is a segmented area. The total number of pixels in the segmented area and the total number of pixels in the ductile iron image can be determined to obtain the area of ​​the segmented area and the area of ​​the ductile iron image, thereby obtaining the ratio of the areas of the two. Among them, different ratios can also reflect different forms and different volume contents of graphite in ductile iron.

[0086] When this implementation is adopted, the flexibility of component distribution category detection can be improved. For example, in some scenarios where area is used to assess component distribution categories, the area can be used for assessment. In other scenarios, the area and shape can be combined for assessment to improve the detection accuracy of component distribution categories, thereby meeting the different needs of users.

[0087] In some embodiments, after obtaining the component distribution categories corresponding to each of the plurality of component distribution areas, the grade of the component can be further determined to evaluate the quality grade of the object including the component. Specifically, the distribution areas corresponding to the component distribution categories belonging to the same target category can be clustered according to the plurality of target categories, and the number of component distribution areas of each target category can be determined, wherein the plurality of target categories respectively characterize different distribution states of the component distribution areas; and the grade of the component can be determined according to the number of component distribution areas of each target category.

[0088] Among them, the target category can refer to the category preset by the user. Generally speaking, after determining the component distribution category of each component distribution area, these component distribution categories are not necessarily all useful for determining the grade of the component, for example, some messy shapes. Therefore, the target category can be set in advance, and each component distribution area is clustered by the target category, and the useful component distribution area is screened out by the target category. Therefore, when clustering multiple component distribution areas by multiple target categories, some low-quality component distribution areas can be filtered out, thereby improving the accuracy of determining the grade of the component.

[0089] In an embodiment of the present application, after obtaining the component distribution categories corresponding to each of the multiple component distribution areas, the component distribution areas belonging to the same component distribution category can be clustered into a group, that is, the segmented areas of the same component distribution category are clustered together, and then the component distribution area clustering groups corresponding to the multiple target categories are obtained, that is, the segmented area clustering groups corresponding to the multiple target categories are obtained, and then, the number of component distribution areas included in each group, that is, the number of segmented areas included in each group can be determined.

[0090] After obtaining the number of component distribution areas included in each group, the number of areas in which the components present different forms can be obtained. In this way, the level of the components can be determined according to the proportion of the number of component distribution areas of multiple target categories.

[0091] For example, still taking ductile iron as an example, assuming that the number of component distribution areas of the component distribution category is spherical, the number of component distribution areas of the flaky category accounts for 2%, the number of component distribution areas of the flocculent category accounts for 1%, and the number of component distribution areas of the worm-like category accounts for 1%, it can be determined that the spherical category component distribution areas account for the largest number. In this way, it can be determined that the spheroidization level of the ductile iron is level 1.

[0092] In practice, in order to realize intelligent detection of component detection, improve the efficiency of component detection and adapt to component detection with different requirements, a neural network model can be used to segment the image to be detected and classify the segmented areas corresponding to multiple component distribution areas. Specifically, two methods can be used to realize component detection of the neural network model.

[0093] The first method A: segmenting the image to be detected and identifying the component distribution categories corresponding to the multiple component distribution areas are achieved through a component detection model, that is, both the above steps S102 and S103 can be achieved through a component detection model.

[0094] Reference Figure 3 As shown, a schematic diagram of the principle of component detection in this way is shown. Specifically, Figure 3 As shown, the component detection model may include a segmentation sub-model and a classification sub-model, wherein the component detection model includes a segmentation sub-model and a classification sub-model connected in series, and the classification sub-model is connected in series to the output end of the segmentation sub-model.

[0095] The segmentation sub-model is used to segment the multiple segmentation regions corresponding to each component distribution region from the image to be detected, and the classification sub-model is used to identify the multiple segmentation regions to output the component distribution categories corresponding to each of the multiple segmentation regions.

[0096] Accordingly, the image to be detected can be input into a component detection model, and the multiple component distribution areas can be divided by the component detection model to obtain the segmented areas corresponding to each of the multiple component distribution areas, and the segmented areas corresponding to each of the multiple component distribution areas can be classified.

[0097] The component detection model may be pre-trained, and the component detection model may include the above-mentioned segmentation sub-model and classification sub-model.

[0098] The component detection model is obtained by training the first initial model using sample images pre-marked with the position, size and corresponding target category of the component distribution area, wherein the target category is one of the multiple target categories described above, and the multiple target categories respectively represent different distribution states of the component distribution area. The model structure of the first initial model is consistent with the structure of the component detection model. The size of the marked component distribution area can be represented by area.

[0099] In this embodiment, when a component detection model is used to implement component detection, the training samples for training the component detection model are sample images including component distribution areas, in which the position of the component distribution area in the sample image, the size of the component distribution area and the target category corresponding to the component distribution area are pre-marked.

[0100] Of course, since the components in the object are not in a uniform form, the shapes and sizes of the distribution areas of the components will be different. Therefore, multiple target categories can be set, and different target categories can represent different distribution states of the component distribution areas. In practice, when the sample image is used to train the first initial model, the sample image can be directly input into the first initial model, and then the loss value of the first initial model is determined according to the output result of the first initial model and the mark in the sample image; and according to the loss value of the first initial model, the parameters of the segmentation sub-model and the classification sub-model in the first initial model are updated, and then the first initial model after multiple updates is used as the component detection model.

[0101] Wherein, when determining the loss value of the first initial model according to the result output by the first initial model and the mark in the sample image, it can be determined in the following manner:

[0102] The classification loss value is determined based on the predicted category of each component distribution area in the sample image output by the classification sub-model and the target category marked by the component distribution area; the positioning loss value is determined based on the predicted position of each segmented area output by the segmentation sub-model and its marked position; and the segmentation loss value is determined based on the size of each segmented area output by the segmentation sub-model and the size of each marked component distribution area; then, the classification loss value, the positioning loss value and the segmentation loss value are weightedly summed to obtain the loss value of the first initial model.

[0103] Among them, the classification loss value is used to characterize the gap between the component distribution category results of the segmented area by the classification sub-model and the marked target category, the positioning loss value is used to characterize the gap between the segmentation of the position of each component distribution area by the segmentation sub-model and the actual position, and the segmentation loss value is used to characterize the gap between the size of each component distribution area segmented by the segmentation sub-model and the actual size of the component distribution area.

[0104] By using the component detection model of the embodiment of the present application to perform component detection, a neural network model can be used to complete the segmentation and classification tasks of the component distribution area. In this way, a neural network model can be deployed on a computer to achieve the purpose of component detection. Compared with the method of using multiple neural network models to jointly complete component detection, the number of times and complexity of the computer's calls to the neural network model can be reduced, thereby ensuring the efficiency of component detection. It is suitable for application scenarios that require rapid component detection results and some proprietary component detection.

[0105] The second method B: using two neural network models to respectively implement the segmentation of the image to be detected and the identification of the component distribution categories corresponding to the multiple component distribution areas, that is, the above steps S102 and S103 can be implemented respectively by two models.

[0106] Reference Figure 4 As shown, a schematic diagram of the principle of component detection in this way is shown. Specifically, Figure 4 As shown, it includes a segmentation model and a classification model, wherein the output of the segmentation model can be input to the input end of the classification model. Specifically, the intelligent terminal or server can first input the image to be detected into the segmentation model, and after obtaining the segmentation area output by the segmentation model, the intelligent terminal or server inputs the segmentation area into the classification model, thereby obtaining the component distribution category of the component distribution area output by the classification model.

[0107] Accordingly, when it is necessary to obtain the segmented regions corresponding to the plurality of component distribution regions, the image to be detected can be input into a pre-trained segmentation model to obtain the segmented regions corresponding to the plurality of component distribution regions. The segmentation model is obtained by training the second initial model using sample images marked with the positions and sizes of the component distribution regions.

[0108] When it is necessary to obtain the component distribution categories corresponding to each of the multiple component distribution areas, the segmented areas corresponding to each of the multiple component distribution areas can be input into a pre-trained classification model to obtain the component distribution categories corresponding to each of the multiple component distribution areas. The classification model is obtained by training a third initial model using sample images pre-labeled with target categories corresponding to the component distribution areas, wherein the target category is one of a plurality of target categories, and the plurality of target categories respectively represent different distribution states of the component distribution areas.

[0109] In this embodiment, the segmentation model and the classification model can be trained separately. Specifically, the segmentation model and the classification model can be trained synchronously, or the segmentation model can be trained first and then the classification model, or the classification model can be trained first and then the segmentation model. When the segmentation model is trained first and then the classification model is trained, the sample image used to train the classification model can be obtained by inputting a sample image including multiple component distribution areas into the segmentation model after the segmentation model is trained.

[0110] Specifically, when training the second initial model to obtain the segmentation model, the training samples used can be sample images marked with the position and size of the component distribution area, wherein the marked position of the component distribution area can be used to characterize the actual position of the component distribution area in the sample image, and the size of the component distribution area can be used to characterize the actual size of the component distribution area in the sample image. Generally, the total number of pixels or area can be used to characterize the size of the component distribution area.

[0111] Among them, when using the sample image to train the second initial model, the sample image can be directly input into the second initial model. Thereafter, the loss value of the second initial model is determined based on the position and size of the segmentation area output by the second initial model in the sample image and the position and size of the marked component distribution area. The parameters in the second initial model are updated according to the loss value of the second initial model. Thereafter, the second initial model after multiple updates is used as the segmentation model.

[0112] Specifically, when training the third initial model and obtaining the classification model, the training samples used can be sample images marked with target categories corresponding to component distribution areas. The sample images can be images of a certain component distribution area. Then, when using the sample images to train the third initial model, the sample images can be directly input into the third initial model. Thereafter, the loss value of the third initial model is determined based on the predicted category output by the third initial model and the target category of the marked component distribution area. The parameters in the third initial model are updated based on the loss value of the third initial model. Thereafter, the third initial model after multiple updates is used as the classification model.

[0113] In this method B, since component detection is completed by two independent models, compared with using a neural network model to complete component detection, component detection can be implemented in stages, so that the component detection tasks in each stage are relatively independent, the segmentation model can be dedicated to image segmentation, and the classification model can be dedicated to image classification, thereby reducing the coupling of component detection tasks. In addition, the segmentation model can also be used in other tasks that require image segmentation (for example, semantic segmentation tasks), and the classification model can also be used in other tasks that require image classification (for example, object classification tasks), so that shared applications in multiple application scenarios can be realized, neural network resources can be saved, and the flexibility of component detection can be improved.

[0114] In one embodiment, when the component distribution categories corresponding to each of the multiple component distribution areas are obtained based on the ratio of the area of ​​each of the multiple component distribution areas to the area of ​​the image to be detected, a neural network model can also be used to output the component distribution categories corresponding to each of the multiple component distribution areas.

[0115] Accordingly, the second method B can be used to perform component detection and train the applicable classification model. That is, after the image to be detected is input into the segmentation model, the multiple segmentation areas output by the segmentation model are input into the classification model trained in this example, so as to obtain the component distribution categories corresponding to the multiple component distribution areas.

[0116] In a specific implementation, the ratio of the area of ​​each of the multiple component distribution regions to the area of ​​the image to be detected can be input into a pre-trained classification model to obtain the component distribution category corresponding to each of the multiple component distribution regions. The classification model is obtained by training the fourth initial model using a sample image pre-labeled with a target category and a target ratio corresponding to the component distribution region, wherein the target category is one of a plurality of target categories, and the plurality of target categories respectively represent different distribution states of the component distribution region, and the target ratio is the ratio of the area of ​​the component distribution region to the area of ​​the sample image.

[0117] The classification model in this embodiment can be obtained by training the fourth initial model using a sample image marked with a target category and a target ratio corresponding to a component distribution area. That is, the sample image including multiple component distribution areas is input to the fourth initial model, and each component distribution area in the sample image is marked with a target ratio of its area to the area of ​​the sample image, as well as the actual component distribution category of the component distribution area under the target ratio.

[0118] When training the fourth initial model, the loss value of the fourth initial model can be determined according to the predicted category of the component distribution area output by the fourth initial model and the marked target category. In this way, the fourth initial model has the ability to determine the component distribution category of the component distribution area according to the ratio of the area of ​​the input sample image to the multiple areas of each component distribution area during continuous training.

[0119] During the training process, the parameters of the fourth initial model can be updated according to the loss value of the fourth initial model, so that the fourth initial model after multiple updates can be determined as the classification model.

[0120] Through this implementation, since the classification model uses sample images marked with target categories and target ratios corresponding to component distribution areas as training samples, the classification model can determine the component distribution category of the segmented area based on the ratio of the area of ​​the component distribution area in the sample image, so as to adapt to component detection scenarios that require evaluating the degree of component penetration into an object and the volume content of a component in an object.

[0121] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0122] Reference Figure 5 As shown, a structural block diagram of a component detection device according to an embodiment of the present application is shown. Figure 5 As shown, the device may specifically include the following modules:

[0123] An image acquisition module 501 is used to obtain an image to be detected, wherein the image to be detected includes a plurality of component distribution areas;

[0124] An image segmentation module 502 is used to segment the image to be detected to obtain segmented areas corresponding to each of the plurality of component distribution areas;

[0125] The category determination module 503 is used to classify the segmented areas corresponding to each of the plurality of component distribution areas to obtain the component distribution categories corresponding to each of the plurality of component distribution areas.

[0126] Optionally, the device may further include the following modules:

[0127] A clustering module, for clustering distribution areas corresponding to component distribution categories belonging to the same target category according to multiple target categories, and determining the number of component distribution areas of each target category, wherein the multiple target categories respectively represent different distribution states of the component distribution areas;

[0128] The grade determination module is used to determine the grade of the component according to the number of component distribution areas of each target category.

[0129] Optionally, the device may further include a first execution module, the first execution module being specifically used to input the image to be detected into a component detection model, divide the multiple component distribution areas through the component detection model, obtain the segmented areas corresponding to each of the multiple component distribution areas, and classify the segmented areas corresponding to each of the multiple component distribution areas; and obtain the component distribution category corresponding to each of the multiple component distribution areas output by the component detection model;

[0130] The component detection model is trained using sample images marked with the location, size and corresponding target category of the component distribution area.

[0131] Optionally, the image segmentation module 502 may be specifically used to input the image to be detected into a segmentation model to obtain segmentation regions corresponding to each of the plurality of component distribution regions, wherein the segmentation model is trained using a sample image marked with positions and sizes of component distribution regions;

[0132] The category determination module 503 can be specifically used to input the segmented areas corresponding to each of the multiple component distribution areas into a classification model to obtain the component distribution categories corresponding to each of the multiple component distribution areas, wherein the classification model is trained using sample images marked with target categories corresponding to the component distribution areas.

[0133] Optionally, the device may further include the following modules:

[0134] An area determination module, used to determine the area of ​​each of the plurality of component distribution areas according to the total number of pixels included in the segmented areas corresponding to each of the plurality of component distribution areas;

[0135] The category determination module can be specifically used to obtain the component distribution category corresponding to each of the multiple component distribution areas according to the ratio of the area of ​​each of the multiple component distribution areas to the area of ​​the image to be detected.

[0136] Optionally, the device may further include the following modules:

[0137] An area determination module, used to determine the area of ​​each of the plurality of component distribution areas according to the total number of pixels included in the segmented areas corresponding to each of the plurality of component distribution areas;

[0138] The category determination module may be specifically used to input the ratio of the area of ​​each of the plurality of component distribution regions to the area of ​​the image to be detected into a pre-trained classification model to obtain the component distribution category corresponding to each of the plurality of component distribution regions;

[0139] The classification model is trained using sample images marked with target categories and target ratios corresponding to component distribution regions, and the target ratio is the ratio of the area of ​​the component distribution region to the area of ​​the sample image.

[0140] Optionally, the image acquisition module 501 may specifically include the following units:

[0141] The first acquisition unit is used to perform microscopic photography on the target object containing the component, and determine the image obtained by performing microscopic photography on the target object as the image to be detected.

[0142] Or, a second acquisition unit is used to acquire the image to be detected outputted after the microscopic imaging device performs microscopic imaging on the target object.

[0143] By using the device of the embodiment of the present application, an image to be detected including multiple component distribution areas can be obtained, and the multiple component distribution areas in the image to be detected can be segmented to obtain segmented areas corresponding to each of the multiple component distribution areas, and then the multiple segmented areas can be classified to obtain component distribution categories corresponding to each of the multiple component distribution areas. In the embodiment of the present application, the component distribution category of each of the multiple component distribution areas where the components are distributed in the object can be automatically obtained by segmenting the image to be detected and then classifying it.

[0144] On the one hand, since the device realizes automated component detection without investing too much manpower cost, the component detection method of the embodiment of the present application can be applied on a large scale with low manpower cost. On the other hand, since the present application can accurately obtain the component distribution categories corresponding to each of the multiple component distribution areas through a series of processing of the image to be detected, the stability of the detection accuracy is improved, avoiding the problem of unreliable component detection results due to differences in workers' experience during manual detection, thereby improving the accuracy of component detection.

[0145] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.

[0146] Reference Figure 6As shown, a structural block diagram of an electronic device 600 according to an embodiment of the present application is shown. Figure 6 As shown, an electronic device provided by an embodiment of the present invention, the electronic device 600 can be used to execute an image processing method, and may include a memory 601, a processor 602, and a computer program stored in the memory and executable on the processor, wherein the processor 602 is configured to execute the component detection method.

[0147] like Figure 6 As shown, in one embodiment, the electronic device 600 may completely include an input device 603, an output device 604 and an image acquisition device 605, wherein, when executing the image processing method of the embodiment of the present application, the image acquisition device 605 may acquire an image to be detected, and then the input device 603 may obtain the image to be detected acquired by the image acquisition device 605, and the image to be detected may be processed by the processor 602 to perform component detection based on the image to be detected, and the output device 604 may output the detection result of the image to be detected.

[0148] Of course, in one embodiment, the memory 601 may include a volatile memory and a non-volatile memory, wherein the volatile memory may be understood as a random access memory for storing and saving data. A non-volatile memory refers to a computer memory in which the stored data does not disappear after the current is turned off. Of course, the computer program of the component detection method of the present application may be stored in a volatile memory and a non-volatile memory, or in either of the two.

[0149] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program that enables a processor to execute the component detection method as described in the embodiment of the present application.

[0150] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0152] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0156] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0157] The above is a detailed introduction to a component detection method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A component detection method, It is characterized in that The method comprises: Obtaining an image to be detected, wherein the image to be detected includes a plurality of component distribution areas; The image to be detected is segmented by using a model trained by using sample images marked with positions and sizes of component distribution areas to obtain segmented areas corresponding to each of the multiple component distribution areas; Classifying the segmented areas corresponding to each of the multiple component distribution areas to obtain the component distribution categories corresponding to each of the multiple component distribution areas, including: determining the component distribution categories corresponding to each of the multiple component distribution areas according to the sizes and / or shapes of the segmented areas corresponding to each of the multiple component distribution areas.

2. The method according to claim 1, It is characterized in that After obtaining the component distribution categories corresponding to each of the plurality of component distribution areas, the method further includes: According to multiple target categories, the distribution areas corresponding to the component distribution categories belonging to the same target category are clustered to determine the number of component distribution areas of each target category, wherein the multiple target categories respectively represent different distribution states of the component distribution areas; The ranking of the components is determined based on the number of component distribution areas for each target category.

3. The method according to claim 1 or 2, It is characterized in that Segmenting the image to be detected to obtain segmented areas corresponding to each of the multiple component distribution areas, and classifying the segmented areas corresponding to each of the multiple component distribution areas to obtain component distribution categories corresponding to each of the multiple component distribution areas, including: Inputting the image to be detected into a component detection model, dividing the multiple component distribution areas by the component detection model to obtain segmented areas corresponding to the multiple component distribution areas, and classifying the segmented areas corresponding to the multiple component distribution areas; Obtaining component distribution categories corresponding to each of the plurality of component distribution areas output by the component detection model; The component detection model is trained using sample images marked with component distribution areas and corresponding target categories.

4. The method according to claim 1 or 2, It is characterized in that Segmenting the image to be detected to obtain segmented regions corresponding to each of the plurality of component distribution regions, including: Inputting the image to be detected into a segmentation model to obtain segmentation regions corresponding to each of the plurality of component distribution regions, wherein the segmentation model is trained using sample images marked with component distribution regions; Classifying the segmented areas corresponding to the plurality of component distribution areas to obtain component distribution categories corresponding to the plurality of component distribution areas, including: The segmented areas corresponding to each of the multiple component distribution areas are input into a classification model to obtain component distribution categories corresponding to each of the multiple component distribution areas, wherein the classification model is trained using sample images marked with target categories corresponding to the component distribution areas.

5. The method according to claim 1, It is characterized in that Determining the component distribution categories corresponding to each of the plurality of component distribution areas according to the sizes of the segmented areas corresponding to each of the plurality of component distribution areas comprises: Determine the area of ​​each of the plurality of component distribution regions according to the total number of pixels included in the segmented regions corresponding to each of the plurality of component distribution regions; The component distribution categories corresponding to each of the plurality of component distribution regions are determined according to respective areas of the plurality of component distribution regions.

6. The method according to claim 5, It is characterized in that According to the respective areas of the plurality of component distribution regions, component distribution categories corresponding to the respective plurality of component distribution regions are obtained, including: Inputting the ratio of the area of ​​each of the plurality of component distribution regions to the area of ​​the image to be detected into a classification model to obtain the component distribution category corresponding to each of the plurality of component distribution regions; The classification model is trained using sample images marked with target categories and target ratios corresponding to component distribution regions, wherein the target ratio is the ratio of the area of ​​the component distribution region to the area of ​​the sample image.

7. The method according to any one of claims 1 to 6, It is characterized in that Obtain the image to be detected, including: Performing microscopic photography on a target object containing the component, and determining an image obtained by performing microscopic photography on the target object as the image to be detected; Or, an image to be detected outputted by a microscopic imaging device after microscopic imaging of the target object is obtained.

8. A component detection device, It is characterized in that The device comprises: An image acquisition module, used for acquiring an image to be detected, wherein the image to be detected includes a plurality of component distribution areas; An image segmentation module, used to segment the image to be detected by using a model trained by using sample images marked with positions and sizes of component distribution areas, to obtain segmented areas corresponding to each of the multiple component distribution areas; A category determination module, used for classifying the segmented areas corresponding to the plurality of component distribution areas to obtain the component distribution categories corresponding to the plurality of component distribution areas; The category determination module is specifically used to determine the component distribution category corresponding to each of the multiple component distribution areas according to the size and / or shape of the segmented area corresponding to each of the multiple component distribution areas.

9. An electronic device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the method, the component detection method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer program stored therein enables the processor to execute the component detection method as described in any one of claims 1-7.