Image clustering method, device, computer device, and computer program
The image clustering method iteratively subdivides groups based on reference parameters to enhance clustering degree, addressing the limitations of predetermined category methods and improving image grouping accuracy.
Patent Information
- Application Number
- JP2023552569
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-08-09
- Filing Date
- 2022-06-20
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-06-20
AI Technical Summary
Current image clustering methods using clustering algorithms do not achieve a high enough clustering degree, as the number of categories is predetermined, leading to insufficient cohesion and separation between image groups.
An image clustering method that determines a first clustering parameter for existing image groups and subdivides them into two new groups based on a reference clustering parameter, iteratively improving the clustering degree by selecting the parameter with the highest indicated clustering for each division, using methods like spectral clustering, k-means, or GMM.
This approach enhances the clustering degree by distinguishing between easily confused images, resulting in improved image grouping and classification accuracy.
Smart Images

Figure 0007739442000023 
Figure 0007739442000024 
Figure 0007739442000025
Abstract
Description
[Technical Field]
[0001] This application claims priority to a Chinese patent application filed with the China Patent Office on August 9, 2021, bearing application number 2021109079733 and entitled "Image clustering method, apparatus, computer equipment and storage medium," the entire contents of which are incorporated herein by reference.
[0002] TECHNICAL FIELD The embodiments of the present application relate to the technical field of artificial intelligence, and in particular to image clustering techniques. [Background technology]
[0003] With the development of computer technology, the demand for image processing is increasing. Image clustering is a commonly used image processing method that classifies multiple images into several different categories. In related art, a target number of categories is generally determined in advance, and then a clustering algorithm is used to classify multiple images into the target number of categories. However, the current situation is that the clustering degree of image clustering using a clustering algorithm is not sufficiently high. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present application provide an image clustering method, apparatus, computer device and storage medium, which can improve the clustering degree of image clustering. [Means for solving the problem]
[0005] According to one aspect, there is provided an image clustering method executed by a computing device, comprising: determining a first clustering parameter based on the M groups of images, the first clustering parameter indicating a degree of clustering of images in the M groups of images, where M is an integer greater than 1; a step of obtaining M+1 reference image groups by dividing the target image group into two image groups for any one target image group among the M image groups, and determining a reference clustering parameter determined based on the M+1 reference image groups as a second clustering parameter of the target image group, wherein the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups; The method includes a step of obtaining M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups when the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, wherein the target second clustering parameter is the second clustering parameter having the highest indicated clustering degree among the second clustering parameters of each of the M image groups.
[0006] According to another aspect, there is provided an image clustering apparatus, the apparatus comprising: a first parameter determination module that determines a first clustering parameter based on the M groups of images, the first clustering parameter indicating a degree of clustering of images in the M groups of images, where M is an integer greater than 1; a second parameter determination module that, for one target image group among the M image groups, obtains M+1 reference image groups by dividing the target image group into two image groups, and determines a reference clustering parameter determined based on the M+1 reference image groups as a second clustering parameter of the target image group, wherein the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups; and an image group division module that, when the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, obtains M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups, wherein the target second clustering parameter is the second clustering parameter that indicates the highest clustering degree among the second clustering parameters of each of the M image groups.
[0007] According to another aspect, there is provided a computer device, the computer device including a processor and a memory, wherein the memory stores at least one computer program, the at least one computer program being loaded and executed by the processor to implement the operations performed in the image clustering method according to the above aspect.
[0008] According to another aspect, there is provided a computer-readable storage medium having stored thereon at least one computer program, the at least one computer program being readable by a processor and executing the operations performed in the image clustering method according to the above aspect.
[0009] According to another aspect, there is provided a computer program product or computer program, the computer program product or computer program comprising computer program code, the computer program code being stored on a computer-readable storage medium, the computer program code being read by a processor of a computing device from the computer-readable storage medium, and the processor executing the computer program code to cause the computing device to perform the operations performed in the image clustering method according to the above aspect. [Effects of the Invention]
[0010] According to the methods, devices, computer devices, and storage media provided in the embodiments of the present application, second clustering parameters are determined for each of the M image groups after dividing each image group into two new image groups, and if the clustering degree indicated by the target second clustering parameter (the second clustering parameter among the second clustering parameters of each of the M image groups that indicates the highest clustering degree) is equal to or greater than the clustering degree indicated by the first clustering parameter before division, the image group corresponding to the target second clustering parameter is divided into two new image groups, thereby improving the clustering degree of images in the image group. Therefore, by dividing the image group into the two new image groups, M+1 image groups are obtained, and the M image groups are subsequently subdivided, thereby further distinguishing between images that are easily confused and improving the clustering degree of the image clustering. [Brief explanation of the drawings]
[0011] [Figure 1] 1 is a schematic diagram of an implementation environment according to an embodiment of the present application; [Figure 2] 1 is a flowchart of an image clustering method according to an embodiment of the present application; [Figure 3] FIG. 1 is a schematic diagram of an image classification model according to an embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of another image classification model according to an embodiment of the present application. [Figure 5] 1 is a flowchart of an image clustering method according to an embodiment of the present application; [Figure 6] FIG. 1 is a schematic diagram of a first feature extraction network according to an embodiment of the present application. [Figure 7] 1 is a flowchart for determining clustering parameters according to an embodiment of the present application; [Figure 8] 1 is a flowchart of a model training method according to an embodiment of the present application; [Figure 9] FIG. 1 is a schematic diagram of training an image classification model according to an embodiment of the present application. [Figure 10] 1 is a flowchart of another image clustering method according to an embodiment of the present application; [Figure 11] 1 is a structural schematic diagram of an image clustering apparatus according to an embodiment of the present application; [Figure 12] FIG. 2 is a structural schematic diagram of another image clustering apparatus according to an embodiment of the present application; [Figure 13] 1 is a structural schematic diagram of a terminal according to an embodiment of the present application; [Figure 14] FIG. 2 is a structural schematic diagram of a server according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0012] In order to make the objectives, technical solutions and advantages of the embodiments of the present application more comprehensible, the following describes the embodiments of the present application in more detail in conjunction with the drawings.
[0013] The image clustering method provided by the embodiments of the present application relates to computer vision technology in artificial intelligence technology. The image clustering method provided by the embodiments of the present application will be described below.
[0014] The image clustering method provided in the embodiments of the present application can be executed by a computer device. Preferably, the computer device can be a terminal or a server. The server can be an independent physical server, a server cluster or a distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs (Content Delivery Networks), big data, and artificial intelligence platforms. The terminal can be, but is not limited to, a smartphone, tablet computer, laptop, desktop computer, smart speaker, smart watch, etc.
[0015] In possible implementations, the computer programs of the embodiments of the present application may be arranged to be executed on one computer device, or may be arranged to be executed on multiple computer devices located at one location, or may be arranged to be executed on multiple computer devices distributed at multiple locations and connected to each other via a communication network, and multiple computer devices distributed at multiple locations and connected to each other via a communication network can constitute a blockchain system.
[0016] In a possible implementation, the computer device of an embodiment of the present application is a node in a blockchain system, the node stores multiple image groups obtained by clustering in the blockchain, and the node or other nodes in the blockchain retrieve the multiple image groups from the blockchain.
[0017] 1 is a schematic diagram of an implementation environment according to an embodiment of the present application, which includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0018] In a possible implementation, the terminal 101 sends multiple images to the server 102, and the server 102 uses a method according to an embodiment of the present application to perform image clustering on the received multiple images to obtain multiple image groups, and then returns the multiple image groups to the terminal 101.
[0019] In another possible implementation, a target application provided by the server 102 is installed on the terminal 101, and the terminal 101 uses the target application to realize functions such as image processing or image transmission. For example, the target application is an image processing application that performs image clustering on multiple images. The server 101 trains an image classification model and deploys the trained image classification model in the target application. The terminal 101 runs the target application, and invokes the image classification model to perform classification processing on multiple images to obtain multiple image groups. The multiple image groups are then subsequently clustered using the method provided in the embodiments of the present application to obtain multiple image groups with a higher degree of clustering.
[0020] 2 is a flowchart of an image clustering method according to an embodiment of the present application. The execution body of the embodiment of the present application is a computer device, which is preferably a terminal or a server in the embodiment corresponding to the above-mentioned FIG. 1. Referring to FIG. 2, the method includes the following steps: 201: A computing device determines a first clustering parameter based on the M image groups.
[0021] The computer device acquires M image groups, where M is an integer greater than 1, and each image group contains at least one image. Images belonging to the same image group have a high degree of similarity, and images belonging to different image groups have a low degree of similarity, and each image group may be regarded as a cluster.
[0022] The computer device determines a first clustering parameter based on the M groups of images, where the first clustering parameter indicates a degree of clustering of the images in the M groups of images. Generally, the larger the first clustering parameter, the higher the degree of clustering between the images, and the smaller the first clustering parameter, the lower the degree of clustering between the images. The degree of clustering reflects the degree of cohesion between images in the same group of images and the degree of separation between images in different groups of images. The higher the degree of cohesion between images in the same group of images and the higher the separation between images in different groups of images, the higher the degree of clustering between the images in the M groups of images.
[0023] 202: For any one target image group among the M image groups, the computer device divides the target image group into two image groups to obtain M+1 reference image groups, and determines the reference clustering parameter determined based on the M+1 reference image groups as the second clustering parameter of the target image group.
[0024] Any of the M image groups may be regarded as a target image group, and for any one of the M image groups, the computer device divides the target image group into two image groups and uses the two image groups and M-1 image groups among the M image groups excluding the target image group as reference image groups, thereby obtaining M+1 reference image groups. The computer device determines a reference clustering parameter based on the M+1 reference image groups, and determines the reference clustering parameter as a second clustering parameter for the target image group, where the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups.
[0025] The computer device can perform the operation in step 202 for each of the M image groups to obtain the second clustering parameters for each of the M image groups, i.e., M second clustering parameters.
[0026] 203: If the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, the computer device obtains M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups, and the target second clustering parameter is the second clustering parameter with the highest indicated clustering degree among the second clustering parameters of each of the M image groups.
[0027] Since the second clustering parameter indicates the clustering degree of images in the M+1 reference image groups, the computer device determines the second clustering parameter with the highest indicated clustering degree from the second clustering parameters of the obtained M image groups as the target second clustering parameter. Correspondingly, the clustering degree of images in the M+1 reference image groups obtained after dividing the target image group corresponding to the target second clustering parameter into two image groups will also be the highest. That is, when attempting to divide an image group among the M image groups into two image groups, the clustering degree of the images can be maximized by dividing the target image group corresponding to the target second clustering parameter into two image groups, and this division method is the optimal division method.
[0028] Here, if the larger the clustering parameter, the higher the degree of clustering indicated, the above target second clustering parameter should be the largest second clustering parameter among the second clustering parameters of each of the M image groups, and if the smaller the clustering parameter, the higher the degree of clustering indicated, the above target second clustering parameter should be the smallest second clustering parameter among the second clustering parameters of each of the M image groups.
[0029] The computer device compares the clustering degree indicated by the target second clustering parameter with the clustering degree indicated by the first clustering parameter, and if the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, after dividing the target image group corresponding to the target second clustering parameter into two image groups, the clustering degree of the images is equal to or greater than the clustering degree of the images of the original M image groups, so the computer device divides the target image group corresponding to the target second clustering parameter into two image groups, thereby obtaining M+1 image groups. In another embodiment, if the clustering degree indicated by the target second clustering parameter is lower than the clustering degree indicated by the first clustering parameter, after dividing the target image group corresponding to the target second clustering parameter into two image groups, the clustering degree of the images is lower than the clustering degree of the images of the original M image groups, so the computer device does not continue to divide the image groups of the M image groups.
[0030] According to the method of the embodiments of the present application, a second clustering parameter is determined for each of the M image groups after dividing each image group into two new image groups, and if the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter before division, the image group corresponding to the target second clustering parameter is divided into two new image groups, thereby improving the clustering degree of images in the image group.By dividing the image group into the two new image groups, M+1 image groups are obtained, and the M image groups are subsequently subdivided, further distinguishing between images that are easily confused and improving the clustering degree of the image clustering.
[0031] In some embodiments, the M image groups are divided based on the classification results of the image classification model for the multiple images, and the image classification model performs a classification process on the images to obtain category labels for the images. Figure 3 is a schematic diagram of an image classification model according to an embodiment of the present application. As shown in Figure 3, the image classification model 30 includes a first feature extraction network 301 and an image classification network 302. The first feature extraction network 301 is connected to the image classification network 302 and performs feature extraction on the images, and the image classification network 302 performs classification process based on the image features.
[0032] In a possible implementation, as shown in FIG. 4, the image classification model 30 further includes a second feature extraction network 303, which is connected to the first feature extraction network 301 and subsequently performs feature extraction on the image features extracted by the first feature extraction network 301.
[0033] 5 is a flowchart of an image clustering method according to an embodiment of the present application. The execution body of the embodiment of the present application is a computer device, which is preferably a terminal or a server in the embodiment corresponding to FIG. 1 above. Referring to FIG. 5, the method includes the following steps: 501: A computing device acquires a plurality of images obtained by photographing a target object.
[0034] The computer device acquires multiple images, each of which is obtained by photographing the same target object. For example, if the target object is a human body, the multiple images may be obtained by photographing different organs of the same human body; if the target object is an organ, the multiple images may be obtained by photographing different parts of the same organ; or if the target object is a scenario, the multiple images may be obtained by photographing the same scenario at different times. Preferably, in the medical field, the multiple images may be digital virtual slides (Whole Slide Images, WSIs), which are images obtained by scanning pathology microsections using a digital pathology scanner, which includes an optical system, a linear scanner camera, and other components.
[0035] 502: The computing device obtains a category label for each of the plurality of images by invoking an image classification model to perform a classification process on each of the plurality of images.
[0036] An image classification model is stored in the computer device, and the image classification model performs a classification process on images. The image classification model may be a convolutional neural network (CNN). The network structure of the image classification model can be referenced in the above embodiment of FIG. 3, and the training process of the image classification model can be referenced in the following embodiment of FIG. 8, and will not be described again here. After acquiring a plurality of images, the computer device invokes the image classification model to perform a classification process on each of the plurality of images, thereby obtaining a category label for each image, and the category label of an image indicates the category to which the image belongs.
[0037] In a possible implementation, the image classification model includes a first feature extraction network and an image classification network, and the first feature extraction network and the image classification network are connected, as shown in Figure 3. For each image of the plurality of images, the computing device invokes the first feature extraction network to perform feature extraction on the image to obtain first image features, and invokes the image classification network to perform classification processing based on the first image features to obtain a category label for the image.
[0038] The input of the first feature extraction network is an image, and the input of the image classification network is the output of the first feature extraction network. Preferably, the image classification network is a neural network consisting of two fully connected layers. The first image features output from the first feature extraction network represent image features, for example, a multidimensional feature vector matrix or an image representing the features.
[0039] In another possible implementation form, the image is a pathological section image, and the first feature extraction network includes K feature extraction layers and a feature transformation layer, where the feature extraction layers extract image features and the feature transformation layer transforms the image features. The computer device invokes the K feature extraction layers to sequentially perform feature extraction on the image, thereby obtaining image features output from each feature extraction layer, and invokes the feature transformation layer to perform feature transformation on the image features output from the last L feature extraction layers, thereby obtaining a first image feature, where L is an integer greater than 1 and less than or equal to K. In the first feature extraction network, the K feature extraction layers are connected in sequence, and the feature transformation layer is connected to the last L feature extraction layers, respectively.
[0040] Specifically, the K feature extraction layers extract image features from shallow to deep layers in order from front to back. The classification of pathological section images depends on the morphological information and texture information of the distribution of cell nuclei in the image, and this information is obtained from the image features extracted by the shallow network. Therefore, when performing feature transformation, not only is feature transformation performed on the image features output from the last feature extraction layer, but also on the image features output from the last L feature extraction layers. As a result, the finally obtained first image features include not only the deep layer image features output from the last feature extraction layer, but also the shallow layer image features output from the feature extraction layer before the last feature extraction layer, thereby improving the feature extraction ability of the first feature extraction network for pathological section images.
[0041] Preferably, the feature extraction layer in the first feature extraction network is a convolutional layer, the feature transformation layer is a fully connected layer, and a pooling layer is further connected between the last L feature extraction layers and the feature transformation layer, and the pooling layer performs a pooling process on the image features extracted by the feature extraction layer. As shown in FIG. 6, the first feature extraction network includes convolutional layers 601 to 604 and a fully connected layer 605, and pooling layers are connected between the last three convolutional layers (i.e., convolutional layers 602 to 604) and the fully connected layer 605. The computer inputs a pathological slice image to the convolutional layer 601 of the first feature extraction network, the image features output from the convolutional layer 601 are input to the convolutional layer 602, the image features output from the convolutional layer 602 are input to the convolutional layer 603 and the pooling layer 612, the image features output from the convolutional layer 603 are input to the convolutional layer 604 and the pooling layer 613, and the image features output from the convolutional layer 604 are input to the pooling layer 614. The image features output from the pooling layer 612, the pooling layer 613, and the pooling layer 614 are all input to the fully connected layer 605, which performs feature transformation on the image features output from the three pooling layers to obtain a first image feature.
[0042] Preferably, the convolution layer in the first feature extraction network is composed of a network structure such as a residual neural network, GoogleNet (a type of neural network), or VGGnet (Visual Geometry Group Network).
[0043] 503: The computer device obtains M image groups by dividing images of the same category into the same image group based on the category label of each image.
[0044] After obtaining the category label for each image, the computer device determines the category to which each image belongs based on the category label for each image. The computer device divides images of the same category into the same image groups to obtain M image groups, where M is an integer greater than 1. Each image group contains at least one image, and images belonging to the same image group belong to the same category and have a high similarity between them, while images belonging to different image groups belong to different categories and have a low similarity between them. The above steps 501 to 503 correspond to obtaining multiple image groups by performing image clustering on the obtained multiple images, and each image group may be considered as one cluster.
[0045] Preferably, the category labels of the images include the probability that the image belongs to each category, and for each image, the category corresponding to the maximum probability in the category labels of the image is determined as the category to which the image belongs.
[0046] Here, in the above steps 501 to 503, the computer device uses an image classification model to determine the category to which each image belongs, and then classifies the multiple images into M image groups based on the category to which each image belongs. However, the number of categories that the image classification model can determine is fixed. For example, if the category labels output from the image classification model include probabilities for K categories, M is necessarily less than K, which corresponds to limiting the number of multiple image groups obtained by clustering multiple images. Therefore, there may be a situation where the cohesion between images within the same image group is not sufficiently high, and as a result, the clustering degree of images in the M image groups is not sufficiently high. Therefore, the computer device further classifies the M image groups by subsequently performing the following steps 504 to 508.
[0047] 504: The computing device determines a first clustering parameter based on the M image groups.
[0048] The computer device determines a first clustering parameter based on the M groups of images, where the first clustering parameter indicates a degree of clustering of the images in the M groups of images. Generally, the larger the first clustering parameter, the higher the degree of clustering between the images, and the smaller the first clustering parameter, the lower the degree of clustering between the images. The degree of clustering reflects the degree of cohesion between images in the same group of images and the degree of separation between images in different groups of images. The higher the degree of cohesion between images in the same group of images and the higher the separation between images in different groups of images, the higher the degree of clustering between the images in the M groups of images.
[0049] In a possible implementation, as shown in FIG. 7, the step of the computer device determining the first clustering parameter based on the first image features of the images in each of the M image groups includes the following steps.
[0050] 701: For each image in the M image groups, the computer device determines a cohesion parameter and a separation parameter corresponding to the image based on a first image feature of the image, a first image feature of other images in the image group to which the image belongs, and a first image feature of images in the other image groups, where the cohesion parameter indicates the dissimilarity between the image and other images in the image group to which the image belongs, and the separation parameter indicates the dissimilarity between the image and images in the other image groups.
[0051] The computer device determines aggregation parameters corresponding to the image based on a first image feature of the image and first image features of other images in the image group to which the image belongs, and determines separation parameters corresponding to the image based on a first image feature of the image and first image features of images in the image groups other than the image group to which the image belongs.
[0052] Illustratively, for each of the other groups of images, the computer device determines candidate separation parameters between the image and the other groups of images based on a first image feature of the image and a first image feature of an image among the other images, thereby determining minimum candidate separation parameters between the image and each of the other groups of images, and determining the minimum candidate separation parameters as separation parameters corresponding to the image.
[0053] For example, the computer device determines the distance between the image and each of the other images in the image group to which the image belongs based on the first image feature of the image and the first image feature of the other images, and determines the average value of the distances between the image and each of the other images as the aggregation parameter corresponding to the image. The smaller the distance between the image and the other images, the higher the similarity between the image and the other images in the same image group, and the smaller the aggregation parameter corresponding to the image. Therefore, the smaller the aggregation parameter corresponding to an image and the lower the dissimilarity between the image and the other images in the image group to which the image belongs, the higher the degree of clustering of the image group.
[0054] For each of the other image groups, the computer device determines a distance between the image and each image in the other image groups based on the first image feature of the image and the first image feature of each image in the other image groups, determines the average value of the distances between the image and the images in the other image groups as a candidate separation parameter between the image and the other image groups, and further determines the smallest candidate separation parameter from the candidate separation parameters between the image and each of the other image groups as a separation parameter corresponding to the image. The larger the distance between the image and an image in the other image groups, the lower the similarity between the image and the images in the other image groups, and the larger the separation parameter corresponding to the image. Therefore, the larger the separation parameter corresponding to an image and the higher the dissimilarity between the image and the images in the other image groups, the higher the clustering degree of the image groups. The distance between images may be a cosine distance, a Euclidean distance, or the like, and the embodiments of the present application are not limited thereto.
[0055] 702: The computer device determines clustering sub-parameters corresponding to the image based on the aggregation parameter and the separation parameter, where the clustering sub-parameters and the aggregation parameter are negatively correlated, and the clustering sub-parameters and the separation parameter are positively correlated.
[0056] The larger the aggregation parameter, the smaller the clustering subparameter corresponding to the image; the smaller the aggregation parameter, the larger the clustering subparameter corresponding to the image; the larger the separation parameter, the larger the clustering subparameter corresponding to the image; the smaller the separation parameter, the smaller the clustering subparameter corresponding to the image; the larger the clustering subparameter corresponding to the image, the higher the clustering degree of the image.
[0057] Preferably, the computer device determines the clustering sub-parameters corresponding to the image using the following formula:
[0058]
number
[0059] Here, i denotes an image, SC(i) denotes a clustering subparameter corresponding to the image, a(i) denotes a cohesion parameter corresponding to the image, and b(i) denotes a separation parameter corresponding to the image.
[0060] 703: The computing device determines a first clustering parameter based on the clustering sub-parameters corresponding to each of the images in the M groups of images.
[0061] The computer device determines clustering subparameters corresponding to each image, and determines a first clustering parameter based on the clustering subparameters corresponding to each of the images. Preferably, the computer device determines the first clustering parameter as an average value of the clustering subparameters corresponding to each of the images.
[0062] Preferably, the closer the first clustering parameter is to 1, the smaller the pitch between multiple images in the same image group and the larger the pitch between multiple images in different image groups, thereby increasing the degree of clustering of the images in the M image groups. The closer the first clustering parameter is to −1, the larger the pitch between multiple images in the same image group and the smaller the pitch between multiple images in different image groups, thereby decreasing the degree of clustering of the images in the M image groups.
[0063] 505: For any one target image group among the M image groups, the computer device obtains M+1 reference image groups by dividing the target image group into two image groups, and determines the reference clustering parameter determined based on the M+1 reference image groups as the second clustering parameter of the target image group.
[0064] Any of the M image groups may be regarded as a target image group, and for any one of the M image groups, the computer device divides the target image group into two image groups and determines the reference clustering parameter determined based on the M+1 reference image groups as the second clustering parameter of the target image group, where the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups. When the computer device performs the operation in step 202 for each of the M image groups, it can obtain the second clustering parameter of each of the M image groups, i.e., M second clustering parameters.
[0065] For example, M is 3, and the M image groups include image group 1, image group 2, and image group 3. The computer device divides image group 1 into image group 11 and image group 12, and determines a second clustering parameter a based on image group 11, image group 12, image group 2, and image group 3. The computer device divides image group 2 into image group 21 and image group 22, and determines a second clustering parameter b based on image group 1, image group 21, image group 22, and image group 3. The computer device divides image group 3 into image group 31 and image group 32, and determines a second clustering parameter c based on image group 1, image group 2, image group 31, and image group 32, to obtain three second clustering parameters, namely, the second clustering parameter a of image group 1, the second clustering parameter b of image group 2, and the second clustering parameter c of image group 3.
[0066] Optionally, the computer device partitions the target image group into two new image groups using any one of clustering algorithms, such as a spectral clustering algorithm, a k-means algorithm (an unsupervised clustering algorithm), or a GMM (Gaussian Mixed Model) expectation maximization clustering algorithm.
[0067] 506: If the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, the computer device obtains M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups, and the target second clustering parameter is the second clustering parameter having the highest indicated clustering degree among the second clustering parameters of each of the M image groups.
[0068] Since the second clustering parameter indicates the clustering degree of images in the M+1 reference image groups, the computer device determines a target second clustering parameter with the highest indicated clustering degree from the second clustering parameters of the obtained M image groups, and the clustering degree of images in the M+1 reference image groups obtained after dividing the target image group corresponding to the target second clustering parameter into two image groups is the highest. The computer device compares the clustering degree indicated by the target second clustering parameter with the clustering degree indicated by the first clustering parameter, and if the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, after dividing the target image group corresponding to the target second clustering parameter into two image groups, the clustering degree of images is equal to or greater than the clustering degree of images in the original M image groups, so the computer device divides the target image group corresponding to the target second clustering parameter into two image groups, thereby obtaining M+1 image groups.
[0069] In another embodiment, if the clustering degree indicated by the target second clustering parameter is lower than the clustering degree indicated by the first clustering parameter, after dividing the target image group corresponding to the target second clustering parameter into two image groups, if the clustering degree of the images is lower than the clustering degree of the images of the original M image groups, the computer device will no longer continue to divide the image groups of the M image groups, and there is no need to perform the following steps 507 to 508.
[0070] 507: For any one target image group among the M+1 image groups, the computer device subsequently divides the target image group into two image groups to obtain M+2 reference image groups, and determines the reference clustering parameter determined based on the M+2 reference image groups as the third clustering parameter of the target image group.
[0071] After obtaining the M+1 image groups, the computer device obtains M+2 reference image groups for one target image group among the M+1 image groups by subsequently dividing the target image group into two image groups, and determines the reference clustering parameter determined based on the M+2 reference image groups as the third clustering parameter of the target image group, where the third clustering parameter indicates the clustering degree of the M+2 reference image groups. The computer device can obtain the third clustering parameter of each image group among the M+1 image groups, i.e., M+1 third clustering parameters, by performing the operation in step 507 for each image group among the M+1 image groups.
[0072] The process of determining the third clustering parameters in step 507 is the same as the process of determining the second clustering parameters in step 505 above, and therefore will not be described in detail here.
[0073] 508: If the clustering degree indicated by the target third clustering parameter is equal to or greater than the clustering degree indicated by the target second clustering parameter, the computer device divides the target image group corresponding to the target third clustering parameter into two image groups until the largest clustering parameter among the multiple clustering parameters obtained after this division becomes smaller than the clustering parameter before division, thereby obtaining M+2 image groups.
[0074] The process of the computer device acquiring M+2 image groups in step 508 is similar to the process of acquiring M+1 image groups in step 506 above, and therefore will not be described here in detail.
[0075] After obtaining the M+2 image groups, the computer device subsequently segments one of the M+2 image groups into a target image group, determines the clustering parameters anew, and determines whether to subsequently segment the M+2 image groups into M+3 image groups based on the magnitude of the clustering parameters. That is, the computer device performs the iterative process multiple times, and steps 505-506 and 507-508 above each represent a single iteration. In the current iteration, if the clustering degree indicated by the target clustering parameter (i.e., the clustering parameter obtained after the current segmentation and indicating the highest clustering degree) among the multiple clustering parameters obtained after the current segmentation is lower than the clustering degree indicated by the target clustering parameter before segmentation (i.e., the clustering parameter obtained after the previous segmentation and indicating the highest clustering degree), the clustering degrees after segmenting the current image group are both lower than the clustering degrees before segmentation, so the computer device stops the iterative process and completes further segmentation of the M image groups.
[0076] For example, the initial M image groups are C={ci}, c i ∈[0,1,...,M-1], and in each iteration, multiple image groups before segmentation are decomposed into C prev and the divided image groups are defined as C cur The number of image groups after partitioning is defined as K, and C prev The clustering parameters corresponding to SC prev Defined as C cur The clustering parameters corresponding to SC cur Define the parameter as C prev =C cur =C, K=M, and execute the following iterative process, stopping the iteration until the iteration termination condition is met. (1) For the current M image groups, the obtained image groups after dividing each image group into two image groups are
number
number
number
number
number
number
number
number
[0077] An embodiment of the present application includes the steps of: performing image clustering based on an image classification model, processing a plurality of images without category labels using an end-to-end image classification model to obtain category labels for each image, and realizing initial image clustering; and performing image clustering based on clustering parameters, further dividing the current plurality of image groups based on the clustering parameters to distinguish image groups with more compact distributions, and completing the process of successively dividing the image groups until all of the clustering degrees indicated by the clustering parameters after division are lower than the clustering degrees indicated by the clustering parameters before division, thereby obtaining a final clustering result.
[0078] According to the method provided by the embodiments of the present application, after dividing each of the M image groups into two new image groups, a second clustering parameter is determined, and if the clustering degree indicated by the target second clustering parameter (the second clustering parameter with the highest indicated clustering degree) is equal to or greater than the clustering degree indicated by the first clustering parameter before division, the image group corresponding to the target second clustering parameter can be divided into two new image groups, thereby improving the clustering degree of images in the image group. Therefore, by dividing the image group into two new image groups, M+1 image groups are obtained, and the M image groups are subsequently subdivided, which further distinguishes between images that are easily confused and improves the clustering degree of the image clustering.
[0079] An image classification model is invoked to determine category labels for a plurality of images, and the plurality of images are divided into M image groups based on the category labels to achieve initial image clustering for the plurality of images. The M image groups are then subsequently subdivided based on the clustering parameters to achieve more accurate image clustering for the plurality of images. By combining the two methods, the efficiency of image clustering can be improved and the clustering degree of image clustering can be increased.
[0080] Then, feature transformation is performed on the image features output from the last L feature extraction layers so that the finally acquired first image features include not only the deep layer image features output from the last feature extraction layer, but also the shallow layer image features output from the feature extraction layer before the last feature extraction layer, thereby improving the feature extraction ability of the first feature extraction network for pathological section images.
[0081] Figure 8 is a flowchart of a model training method provided by an embodiment of the present application, and the image classification model trained by the embodiment of the present application may be applied to the embodiment of Figure 5 above. The execution body of the method is a computer device, and the computer device may be a terminal or a server in the embodiment corresponding to Figure 1 above. Referring to Figure 8, the method includes the following steps: 801: A computer device acquires a sample image.
[0082] The sample image may be any type of image and may be obtained in any manner, for example, the computer device obtains multiple pathological slice images of different organs of different human bodies, divides each pathological slice image into multiple image blocks having the same size, and the divided multiple image blocks are used as the sample image.
[0083] The sample images in the embodiments of the present application are images without actual category labels, and the training method in the embodiments of the present application is a training method that performs unsupervised learning based on unlabeled sample images.
[0084] 802: The computer device performs disturbance processing on each of the sample images in different ways to obtain multiple disturbance images.
[0085] The computer device uses a disturbance processing method to enhance the randomness of the sample image, and the computer device uses different methods to perform disturbance processing on each sample image to obtain a plurality of different disturbance images.
[0086] Different disturbance processing methods include different disturbance types, such as dithering, Gaussian blur, rotation, and cropping and enlarging to the original size after partial cropping. Each disturbance processing may include only one disturbance type or multiple disturbance types. Preferably, during each disturbance processing of the sample image, multiple disturbance types are traversed. For the currently traversed disturbance type, the computer device determines whether to select the current disturbance type according to the occurrence probability of the disturbance type. If YES, the computer device performs the disturbance processing according to the currently traversed disturbance type and then traverses the next disturbance type. If NO, the computer device does not need to perform the disturbance processing according to the currently traversed disturbance type, and directly traverses the next disturbance type until the last disturbance type is reached. The computer device then performs another disturbance processing on the sample image according to the above steps to obtain another disturbance image. Optionally, the occurrence probability of each type of disturbance is set to 0.5 to enhance the randomness of the disturbance image.
[0087] For example, if two sample images are each subjected to disturbance processing twice, the computer device selects multiple disturbance types according to the occurrence probability of various disturbance types, and performs disturbance processing on each of the two sample images according to the currently selected multiple disturbance types to obtain two disturbance images.Then, the computer device selects multiple disturbance types according to the occurrence probability of various disturbance types, and performs disturbance processing on each of the two sample images according to the currently selected multiple disturbance types to obtain two disturbance images again.As a result, the computer device obtains four disturbance images.
[0088] 803: The computing device obtains a category label for each disturbance image by invoking the image classification model to be trained so as to perform classification processing on each disturbance image.
[0089] In one possible implementation, the image classification model includes a first feature extraction network and an image classification network. For each disturbance image, the computing device invokes the first feature extraction network to perform feature extraction on the disturbance image to obtain second image features, and invokes the image classification network to perform classification processing based on the second image features to obtain a category label of the disturbance image. The category label is not an actual category label of the disturbance image, but a pseudo label predicted by the image classification model.
[0090] In another possible implementation, as shown in Figure 4, the image classification model further includes a second feature extraction network. After obtaining the second image features, the computer device further invokes the second feature extraction network to perform feature extraction on the second image features, thereby obtaining third image features.
[0091] The second feature extraction network is connected to the first feature extraction network, and both the first and second feature extraction networks extract image features, with the difference being that the first feature extraction network extracts image features, while the second feature extraction network extracts image feature features, and the second image feature extracted by the second feature extraction network is a deeper feature than the first image feature extracted by the first feature extraction network. The third image feature in the embodiment of the present application is applied to training an image classification model, and the process of using the third image feature to train an image classification model can be seen in step 804 below and will not be described here.
[0092] The process of acquiring the second image features and the category label of the disturbance image in step 803 is the same as the process of acquiring the first image features and the category label of the image in step 502 above, and therefore will not be described in detail here.
[0093] 804: The computing device trains an image classification model based on the category label of each disturbance image.
[0094] After obtaining the category label of each disturbance image, the computer device trains an image classification model based on the category label of each disturbance image to improve the classification ability of the image classification model. For any given image, the trained image classification model performs a classification process on the image to obtain a category label for the image. Preferably, the category label includes a probability that the image belongs to each category, and the category corresponding to the maximum probability in the category label is the category to which the image belongs.
[0095] In a possible implementation, the number of sample images is multiple, and the category labels of the disturbance images include probabilities that the disturbance images belong to each category. The computer device acquires multiple disturbance images obtained by performing disturbance processing on the same sample image, determines a first difference parameter between the probabilities that the acquired multiple disturbance images belong to the same category, acquires multiple disturbance images obtained by performing disturbance processing on different sample images, determines a second difference parameter between the probabilities that the acquired multiple disturbance images belong to the same category, and trains an image classification model based on the first difference parameter and the second difference parameter, thereby reducing the first difference parameter and increasing the second difference parameter obtained by calling the trained image classification model.
[0096] For multiple disturbance images obtained by performing disturbance processing on the same sample image, since the multiple disturbance images originate from the same sample image, the categories to which the multiple disturbance images belong should be similar to the categories to which the sample image belongs, i.e., the categories to which the multiple images belong should also be similar. The category labels of the disturbance images are predicted by an image classification model. If the accuracy rate of the image classification model is sufficiently high, the probabilities for each category that the multiple disturbance images belong to should be sufficiently close. Therefore, the computer device determines a first difference parameter between the probabilities that the multiple disturbance images belong to the same category. The smaller the first difference parameter, the closer the probabilities that the multiple disturbance images belong to the same category, and the more accurate the image classification model. Therefore, the computer device trains the image classification model based on the first difference parameter, thereby reducing the first difference parameter and improving the classification ability of the image classification model.
[0097] For multiple disturbance images obtained by performing disturbance processing on different sample images, the multiple disturbance images originate from different sample images, and therefore the categories to which the multiple disturbance images belong are similar to the categories to which the different sample images belong, i.e., the categories to which the multiple images belong are different. The category labels of the disturbance images are predicted by an image classification model. If the accuracy rate of the image classification model is sufficiently high, the difference in the probabilities that the multiple disturbance images belong to each category should be sufficiently large. Therefore, the computer device determines a second difference parameter between the probabilities that the multiple disturbance images belong to the same category. The larger the second difference parameter, the larger the difference between the probabilities that the multiple disturbance images belong to the same category, and the more accurate the image classification model. Therefore, the computer device trains the image classification model based on the second difference parameter, thereby increasing the second difference parameter and improving the classification ability of the image classification model.
[0098] In another possible implementation, the image classification model further includes a second feature extraction network, and in the above step 803, after obtaining the second image features, the computer device further obtains third image features by invoking the second feature extraction network to perform feature extraction on the second image features, and the computer device further trains the image classification model based on the third image features of each disturbance image.
[0099] Preferably, when the number of sample images is plural, the process of training the image classification model based on the third image feature of each disturbance image includes the following steps: the computer device acquires a plurality of disturbance images obtained by performing disturbance processing on the same sample image, determines a third difference parameter between the third image features of the acquired plurality of disturbance images, acquires a plurality of disturbance images obtained by performing disturbance processing on different sample images, determines a fourth difference parameter between the third image features of the acquired plurality of disturbance images, and trains the image classification model based on the third difference parameter and the fourth difference parameter, thereby reducing the third difference parameter and increasing the fourth difference parameter obtained by calling the trained image classification model.
[0100] For multiple disturbance images obtained by performing disturbance processing on the same sample image, since the multiple disturbance images originate from the same sample image, the image features of the multiple disturbance images are similar to the image features of the sample image, i.e., the image features of the multiple images are also similar. If the accuracy rate of the image classification model is sufficiently high, the image features of each disturbance image extracted by the image classification model should be sufficiently close. Therefore, the computer device determines a third difference parameter between the third image features of the multiple disturbance images. The smaller the third difference parameter, the closer the third image features of the multiple disturbance images are and the more accurate the image classification model is. Therefore, the computer device trains the image classification model based on the third difference parameter, thereby reducing the third difference parameter and improving the classification ability of the image classification model.
[0101] For multiple disturbance images obtained by performing disturbance processing on different sample images, the multiple disturbance images are derived from different sample images, so the image features of the multiple disturbance images are similar to those of the different sample images, i.e., the image features of the multiple images are dissimilar. If the accuracy rate of the image classification model is sufficiently high, the difference between the image features of each disturbance image extracted by the image classification model should be sufficiently large. Therefore, the computer device determines a fourth difference parameter between the third image features of the multiple disturbance images. The larger the fourth difference parameter, the greater the difference between the third image features of the multiple disturbance images, and the more accurate the image classification model. Therefore, the computer device trains the image classification model based on the fourth difference parameter, thereby increasing the fourth difference parameter and improving the classification ability of the image classification model.
[0102] Preferably, the computer device determines a first loss value based on the first difference parameter and the second difference parameter, determines a second loss value based on the third difference parameter and the fourth difference parameter, and performs a weighted sum on the first loss value and the second loss value to obtain a target loss value, and trains an image classification model based on the target loss value to reduce the target loss value obtained by calling the trained image classification model.
[0103] The first loss value and the first differential parameter are positively correlated, and the first loss value and the second differential parameter are negatively correlated. That is, the larger the first differential parameter, the larger the first loss value; the smaller the first differential parameter, the smaller the first loss value; the larger the second differential parameter, the smaller the first loss value; and the smaller the second differential parameter, the larger the first loss value. The second loss value and the third differential parameter are positively correlated, and the third loss value and the fourth differential parameter are negatively correlated. That is, the larger the third differential parameter, the larger the second loss value; the smaller the third differential parameter, the smaller the second loss value; the larger the fourth differential parameter, the smaller the second loss value; and the smaller the fourth differential parameter, the larger the second loss value. Preferably, both the weight coefficients corresponding to the first loss value and the second loss value are 0.5.
[0104] In the embodiment of the present application, comparative learning is performed based on disturbance images derived from the same sample image and based on disturbance images derived from different sample images, thereby improving the feature extraction ability and the ability to distinguish between images of different categories of the image classification model. By adopting the comparative learning method, unsupervised training of the image classification model is realized, eliminating the need to manually mark sample images, saving manpower and time and avoiding incorrect labels caused by artificial marking, thereby improving the training efficiency and accuracy rate of the image classification model.
[0105] In a possible implementation, the process of training the image classification model in the embodiments of the present application is unsupervised training, because there are no actual sample category labels during the training process, and the image classification model cannot determine the actual meaning of each category, but can only determine the probability that an image belongs to each category. Preferably, the computer device does not need to determine the actual meaning of each category, and can subsequently use the image classification model to classify multiple images into different categories. Preferably, the computer device uses the image classification model to classify multiple images into different categories, and then manually determines the actual meaning of each category based on the classification results. For example, in the medical field, the image classification model classifies pathological section images into seven categories, each category representing one physiological tissue type, and the doctor determines the physiological tissue type represented by each category based on the classification results.
[0106] Here, the above steps 801 to 804 are described as an example of a single iteration process, and multiple iterations of training are performed during the training process of the image processing model. In a possible implementation, the computer device stops the training of the image classification model in response to the number of iterations reaching a first threshold, or stops the training of the image classification model in response to the loss value for the current iteration being equal to or less than a second threshold. Both the first threshold and the second threshold are set based on actual needs, for example, the first threshold is 10 or 15, and the second threshold is 0.01 or 0.02.
[0107] In an embodiment of the present application, the step of training an image classification model includes: (1) Data to be prepared: a set of unlabeled sample images, the total number of iterations E for model training, the number of sample images N for each iteration, a randomness enhancement policy, and a weighting factor for the loss value.
number
number
number
number
number
number
number
number
number
number
number
number
number
[0108] According to the method provided in the embodiments of the present application, comparative learning is performed based on disturbance images derived from the same sample image and based on disturbance images derived from different sample images, thereby improving the feature extraction ability and the ability to distinguish between images of different categories of the image classification model. By adopting the comparative learning method, unsupervised training of the image classification model is realized, eliminating the need to manually mark sample images, saving manpower and time and avoiding incorrect labels caused by artificial marking, thereby improving the training efficiency and accuracy rate of the image classification model.
[0109] The above embodiment can be applied to any scenario that requires image clustering, and can perform image clustering on any type of image. For example, in the medical field, image clustering is performed on multiple pathological slice images of patients according to physiological tissue type. Figure 10 is a flowchart of an image clustering method provided in an embodiment of the present application. Refer to Figure 10, the method includes the following steps: 1001: A pathological microscopic section of a patient is scanned as a digital image using a digital pathological scanner to obtain a pathological section image. 1002: The pathological section image is divided into a plurality of pathological section image blocks to construct an unlabeled dataset. 1003: An image classification model is invoked to perform classification processing on each pathological section image block, thereby obtaining image features and category labels for each image block, and dividing the multiple pathological section image blocks into M image groups based on the category labels. 1004: After obtaining the M image groups, the M image groups are successively subdivided according to the clustering parameters, and finally partitioned into N image groups.
[0110] In an embodiment of the present application, image clustering is performed on unlabeled pathological section image blocks to divide the pathological section image blocks into multiple image groups, each representing a physiological tissue, to support subsequent pathological analysis tasks, such as: performing abnormality prediction or prognosis processing based on the proportion of physiological tissues; and comparing a tissue image group with a normal tissue image group to determine whether the tissue is abnormal, where each image group corresponds to a physiological tissue.
[0111] In addition to performing image clustering on pathological section images according to physiological tissue type, image clustering on pathological section images may also be performed according to other criteria, such as performing image clustering on pathological section images according to quality categories, such as uneven staining, thick sections, scalpel movements, or wrinkled sections, or performing image clustering on pathological section images according to cell categories, such as cell categories including suspicious cells and normal cells.
[0112] 11 is a structural schematic diagram of an image clustering device provided in an embodiment of the present application. Referring to FIG. 11, the device includes: a first parameter determination module 1101 for determining a first clustering parameter based on the M image groups, the first clustering parameter indicating a clustering degree of images in the M image groups, where M is an integer greater than 1; a second parameter determination module 1102 that, for one target image group among the M image groups, obtains M+1 reference image groups by dividing the target image group into two image groups, and determines a reference clustering parameter determined based on the M+1 reference image groups as a second clustering parameter of the target image group, wherein the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups; and an image group division module 1103 that, if the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, divides the target image group corresponding to the target second clustering parameter into two image groups to obtain M+1 image groups, wherein the target second clustering parameter is the second clustering parameter that indicates the highest clustering degree among the second clustering parameters of each of the M image groups.
[0113] According to the image clustering device provided by the embodiments of the present application, after dividing each of the M image groups into two new image groups, a second clustering parameter is determined, and if the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter before division, the image group corresponding to the target second clustering parameter is divided into two new image groups, thereby improving the clustering degree of images in the image group. Therefore, by dividing the image group into the two new image groups, M+1 image groups are obtained, and the M image groups are subsequently subdivided, thereby further distinguishing between images that are easily confused and improving the clustering degree of the image clustering.
[0114] Preferably, referring to FIG. 12, the second parameter determination module 1102 further comprises: For any one target image group among the M+1 image groups, obtain M+2 reference image groups by dividing the target image group into two image groups, and determine the reference clustering parameter determined based on the M+2 reference image groups as a third clustering parameter of the target image group, where the third clustering parameter indicates the clustering degree of images in the M+2 reference image groups; The image group division module 1103 further determines that if the clustering degree indicated by the target third clustering parameter is equal to or greater than the clustering degree indicated by the target second clustering parameter, it divides the target image group corresponding to the target third clustering parameter into two image groups to obtain M+2 image groups, and the target third clustering parameter is the third clustering parameter with the highest indicated clustering degree among the third clustering parameters of each of the M+1 image groups, and if the clustering degree indicated by the target third clustering parameter is lower than the clustering degree indicated by the target second clustering parameter, it determines that the image clustering process for the image group is completed.
[0115] Preferably, referring to FIG. 12, the apparatus comprises: an image acquisition module 1104 for acquiring a plurality of images obtained by photographing a target object; a classification processing module 1105 that calls an image classification model to perform classification processing on each of a plurality of images, thereby obtaining a category label for each image; The image classification module 1106 further includes a classification module for classifying images of the same category into the same image groups based on the category labels of each of the plurality of images to obtain M image groups.
[0116] Preferably, referring to FIG. 12, the image classification model includes a first feature extraction network and an image classification network, and the classification processing module 1105: a first feature extraction unit 1115 for obtaining, for each image of the plurality of images, a first image feature by invoking a first feature extraction network to perform feature extraction on the image; a classification processing unit 1125 for obtaining a category label for the image by invoking the image classification network to perform classification processing based on the first image feature.
[0117] Preferably, referring to FIG. 12, the first parameter determination module 1101 comprises: a first parameter determination unit 1111 for determining, for each image in the M image groups, an aggregation parameter and a separation parameter corresponding to the image based on a first image feature of the image, a first image feature of other images in the image group to which the image belongs, and a first image feature of images in the other image groups, wherein the aggregation parameter indicates a dissimilarity between the image and other images in the image group to which the image belongs, and the separation parameter indicates a dissimilarity between the image and images in the other image groups; a second parameter determination unit 1121 for determining clustering sub-parameters corresponding to the image based on the aggregation parameter and the separation parameter, where the clustering sub-parameters and the aggregation parameter are negatively correlated, and the clustering sub-parameters and the separation parameter are positively correlated; and a third parameter determining unit 1131 for determining a first clustering parameter based on the clustering sub-parameters corresponding to each of the images in the M groups of images.
[0118] Preferably, referring to FIG. 12 , the image is a pathological section image, and the first feature extraction network includes K feature extraction layers and a feature transformation layer, and the first feature extraction unit 1115 comprises: Call K feature extraction layers to extract features from the image in order, obtain the image features output from each feature extraction layer, and A first image feature is obtained by invoking a feature transformation layer to perform feature transformation on the image features output from the last L feature extraction layers, where L is an integer greater than 1 and less than or equal to K.
[0119] Preferably, referring to FIG. 12, the device a sample image acquisition module 1107 for acquiring a sample image; a disturbance processing module 1108 that performs disturbance processing on each of the sample images in different ways to obtain a plurality of disturbance images; and a model training module 1109 for training an image classification model based on the category label of each disturbance image; The classification module 1105 further obtains a category label for each disturbance image by invoking the image classification model being trained to perform classification on each disturbance image.
[0120] Preferably, referring to FIG. 12, the number of sample images is plural, and the category label of the disturbance image includes a probability that the disturbance image belongs to each category, and the model training module 1109: a first difference parameter determination unit 1119 that acquires a plurality of disturbance images obtained by performing disturbance processing on the same sample image, and determines a first difference parameter between the probabilities that the acquired plurality of disturbance images belong to the same category; a second difference parameter determining unit 1129 for obtaining a plurality of disturbance images obtained by performing disturbance processing on different sample images, and determining a second difference parameter between the probabilities that the obtained plurality of disturbance images belong to the same category; and a first model training unit 1139 that trains an image classification model based on the first difference parameter and the second difference parameter, thereby reducing the first difference parameter and increasing the second difference parameter obtained by calling the trained image classification model.
[0121] Preferably, referring to FIG. 12, the image classification model includes a first feature extraction network and an image classification network, and the classification processing module 1105: a first feature extraction unit 1115 for each disturbance image, invoking a first feature extraction network to perform feature extraction on the disturbance image to obtain second image features; and a classification processing unit 1125 for obtaining a category label for the disturbance image by invoking the image classification network to perform classification processing based on the second image feature.
[0122] Preferably, referring to FIG. 12, the image classification model further includes a second feature extraction network, and the classification processing module 1105: a second feature extraction unit 1135 for obtaining a third image feature by invoking a second feature extraction network to perform feature extraction on the second image feature; The model training module 1109 A second model training unit 1149 is included to train an image classification model based on the third image feature of each disturbance image.
[0123] Preferably, referring to FIG. 12, the number of sample images is plural, and the second model training unit 1149: acquiring a plurality of disturbance images obtained by performing disturbance processing on the same sample image, and determining a third difference parameter between a third image feature of the acquired plurality of disturbance images; Obtaining a plurality of disturbance images obtained by performing disturbance processing on different sample images, and determining a fourth difference parameter between third image features of the plurality of obtained disturbance images; By training an image classification model based on the third difference parameter and the fourth difference parameter, the third difference parameter obtained by calling the trained image classification model is reduced and the fourth difference parameter is increased.
[0124] Here, when the image clustering device provided in the above embodiments performs image clustering, only the division of each of the above functional modules is described as an example, and in actual application, the above functions can be allocated to be completed by different functional modules according to needs, that is, all or part of the above-described functions can be completed by dividing the internal structure of a computer device into different functional modules. Furthermore, since the image clustering device provided in the above embodiments and the image clustering method embodiments belong to the same concept, the specific implementation process can be referred to the method embodiments, and will not be described in detail here.
[0125] An embodiment of the present application further provides a computer device, which includes a processor and a memory, and at least one computer program is stored in the memory, and the at least one computer program is read and executed by the processor to realize the operations performed by the image clustering method of the above embodiment.
[0126] Optionally, the computer device is provided as a terminal. Figure 13 is a structural schematic diagram of a terminal 1300 provided by one exemplary embodiment of the present application.
[0127] The terminal 1300 includes a processor 1301 and a memory 1302 .
[0128] The processor 1301 may include one or more processing cores, such as a 4-core processor or an 8-core processor. The processor 1301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), or a PLA (Programmable Logic Array). The processor 1301 may include a main processor, also called a CPU (Central Processing Unit), for processing data in a wake state, and a coprocessor, which is a low-power processor for processing data in a standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content that needs to be displayed on a display screen. In some embodiments, the processor 1301 may include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
[0129] The memory 1302 may include one or more non-transitory computer-readable storage media. The memory 1302 may include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices or flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 stores at least one computer program, which is executed by the processor 1301 to implement the image clustering methods provided by the method embodiments of the present application.
[0130] In some embodiments, preferably, terminal 1300 further includes a peripheral interface 1303 and at least one peripheral. The processor 1301, memory 1302, and peripheral interface 1303 are connected by a bus or signal lines. Each peripheral is connected to peripheral interface 1303 by a bus, signal line, or circuit board. Optionally, the peripheral includes at least one of a radio frequency circuit 1304, a display screen 1305, a camera unit 1306, an audio circuit 1307, a positioning unit 1308, and a power supply 1309.
[0131] In some embodiments, terminal 1300 further includes one or more sensors 1310, including, but not limited to, an acceleration sensor 1311, a gyro sensor 1312, a pressure sensor 1313, a fingerprint sensor 1314, a light sensor 1315, and a proximity sensor 1316.
[0132] As will be appreciated by those skilled in the art, the architecture of FIG. 13 is not limiting of terminal 1300, which may include more or fewer components than those shown, or may combine some components, or may employ different components in its configuration.
[0133] Preferably, the computer device is provided as a server. Figure 14 is a structural diagram of a server provided in an embodiment of the present application. The server 1400 may vary greatly due to differences in configuration or performance. It includes one or more processors (Central Processing Units, CPUs) 1401 and one or more memories 1402. At least one computer program is stored in the memory 1402, and the at least one computer program is loaded and executed by the processor 1401 to implement the methods provided in the above method embodiments. Of course, the server may also include components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output, and the server may further include other components for implementing device functions, which are not specifically mentioned here.
[0134] An embodiment of the present application further provides a computer-readable storage medium, which stores at least one computer program, and the at least one computer program is read and executed by a processor to realize the operations performed by the image clustering method of the above embodiment.
[0135]
[0013] Embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer program code, the computer program code being stored in a computer-readable storage medium, a processor of the computer device reading the computer program code from the computer-readable storage medium, and the processor executing the computer program code, thereby causing the computer device to perform the operations performed by the image clustering method of the above embodiment. In some embodiments, the computer program of the embodiments of the present application may be arranged to be executed on a single computer device, or may be executed on multiple computer devices located in a single location, or may be executed on multiple computer devices distributed across multiple locations and connected to each other via a communication network, and multiple computer devices distributed across multiple locations and connected to each other via a communication network may constitute a blockchain system.
[0136] As can be understood by those skilled in the art, the realization of all or part of the steps in the above embodiments may be completed by hardware, or may be completed by a program instructing relevant hardware to complete the steps, and the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, such as a magnetic disk or an optical disk.
[0137] The above does not limit the embodiments of the present application, but is merely a preferred embodiment of the present application, and any amendments, equivalent replacements, improvements, etc. made within the spirit and principle of the embodiments of the present application are included in the protection scope of the present application. [Explanation of symbols]
[0138] 101 terminals 102 Server 30 Image Classification Models 301 First feature extraction network 302 Image Classification Network 303 Second feature extraction network 601 Convolutional Layer 602 Convolutional Layer 603 Convolutional Layer 604 convolutional layers 605 Fully connected layer 612 Pooling Layer 613 Pooling Layer 614 Pooling Layer 901 First feature extraction network 902 Second feature extraction network 903 Image Classification Network 1101 first parameter determination module 1102 second parameter determination module 1103 Image Group Segmentation Module 1104 Image Acquisition Module 1105 Classification Processing Module 1106 Image Segmentation Module 1107 Sample Image Acquisition Module 1108 Disturbance Processing Module 1109 Model Training Module 1111 first parameter determination unit 1115 First Feature Extraction Unit 1119 First Differential Parameter Determination Unit 1121 second parameter determination unit 1125 Classification Processing Unit 1129 Second Differential Parameter Determination Unit 1131 Third parameter determination unit 1135 Second Feature Extraction Unit 1139 First Model Training Unit 1149 Second Model Training Unit 1300 terminals 1301 processor 1302 memory 1303 Peripheral Device Interface 1304 Radio Frequency Circuits 1305 Display Screen 1306 Camera Unit 1307 Audio Circuit 1308 Positioning Unit 1309 Power supply 1310 Sensor 1311 Accelerometer 1312 Gyro Sensor 1313 Pressure Sensor 1314 Fingerprint Sensor 1315 Light Sensor 1316 Proximity Sensor 1400 servers 1401 processor 1402 memory
Claims
1. 1. A computerized method for image clustering, comprising: determining a first clustering parameter based on M image groups obtained using a convolutional neural network (CNN) model as an image classification model, wherein the first clustering parameter indicates a degree of clustering of images in the M image groups, and M is an integer greater than 1; a step of obtaining M+1 reference image groups by dividing the target image group into two image groups for any one of the M image groups, and determining a reference clustering parameter determined based on the M+1 reference image groups as a second clustering parameter of the target image group, wherein the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups; a step of obtaining M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups when the clustering degree indicated by the target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, wherein the target second clustering parameter is the second clustering parameter having the highest indicated clustering degree among the second clustering parameters of each of the M image groups; Including, The step of determining a first clustering parameter based on the M image groups includes: for each image in the M image groups, determining a cohesion parameter and a separation parameter corresponding to the image based on a first image feature of the image, a first image feature of other images in the image group to which the image belongs, and a first image feature of images in the other image groups, wherein the cohesion parameter indicates a dissimilarity between the image and the other images in the image group to which the image belongs, and the separation parameter indicates a dissimilarity between the image and images in the other image groups; determining a clustering sub-parameter corresponding to the image based on the aggregation parameter and the separation parameter, wherein the clustering sub-parameter and the aggregation parameter are negatively correlated, and the clustering sub-parameter and the separation parameter are positively correlated; determining the first clustering parameter based on corresponding clustering sub-parameters of each of the images in the M groups of images; A method comprising:
2. After obtaining M+1 image groups by dividing the target image group corresponding to the target second clustering parameter into two image groups, a step of obtaining M+2 reference image groups by dividing the target image group into two image groups for any one of the M+1 image groups, and determining a reference clustering parameter determined based on the M+2 reference image groups as a third clustering parameter of the target image group, wherein the third clustering parameter indicates the degree of clustering of images in the M+2 reference image groups; a step of obtaining M+2 image groups by dividing the target image group corresponding to the target third clustering parameter into two image groups when the clustering degree indicated by the target third clustering parameter is equal to or greater than the clustering degree indicated by the target second clustering parameter, wherein the target third clustering parameter is the third clustering parameter having the highest indicated clustering degree among the third clustering parameters of each of the M+1 image groups; determining that the image clustering process for the image group is complete if the clustering degree indicated by the target third clustering parameter is lower than the clustering degree indicated by the target second clustering parameter; The method of claim 1 further comprising:
3. before determining a first clustering parameter based on the M image groups, acquiring a plurality of images obtained by photographing a target object; obtaining a category label for each of the plurality of images by invoking the image classification model to perform a classification process on each of the plurality of images; obtaining the M image groups by dividing images of the same category into the same image group based on the category labels of the images; The method of claim 1 further comprising:
4. The image classification model includes a first feature extraction network and an image classification network, and the step of obtaining a category label for each of the plurality of images by invoking the image classification model to perform a classification process on each of the plurality of images includes: for each of the plurality of images, obtaining first image features by invoking the first feature extraction network to perform feature extraction on the image; obtaining a category label for the image by invoking the image classification network to perform a classification process based on the first image feature; 4. The method of claim 3, comprising:
5. The image is a pathological section image, the first feature extraction network includes K feature extraction layers and a feature transformation layer, and the step of acquiring first image features by invoking the first feature extraction network to perform feature extraction on the image includes: Invoking the K feature extraction layers to sequentially extract features from the image, thereby obtaining image features output from each feature extraction layer; acquiring the first image feature by invoking the feature transformation layer to perform feature transformation on image features output from the last L feature extraction layers, where L is an integer greater than 1 and less than or equal to K; 5. The method of claim 4, comprising:
6. The training process of the image classification model includes: acquiring a sample image; performing disturbance processing on the sample image using different methods to obtain a plurality of disturbance images; obtaining a category label for each disturbance image by invoking the image classification model being trained to perform a classification process on each of the disturbance images; training the image classification model to be trained based on the category label of each disturbance image; 4. The method of claim 3, comprising:
7. the number of the sample images is plural, and category labels of the disturbance images include probabilities that the disturbance images belong to each category; and the step of training the image classification model to be trained based on the category labels of the disturbance images includes: acquiring a plurality of disturbance images obtained by performing disturbance processing on the same sample image, and determining a first difference parameter between probabilities that the acquired plurality of disturbance images belong to the same category; obtaining a plurality of disturbance images obtained by performing disturbance processing on different sample images, and determining a second difference parameter between the probabilities that the obtained plurality of disturbance images belong to the same category; training the image classification model to be trained based on the first difference parameter and the second difference parameter, thereby reducing the first difference parameter and increasing the second difference parameter obtained by calling the trained image classification model; 7. The method of claim 6, comprising:
8. The image classification model includes a first feature extraction network and an image classification network, and the step of obtaining a category label for each disturbance image by invoking the image classification model to be trained to perform a classification process on each disturbance image includes: for each disturbance image, obtaining second image features by invoking the first feature extraction network to perform feature extraction on the disturbance image; obtaining a category label for the disturbance image by invoking the image classification network to perform a classification process based on the second image feature; 7. The method of claim 6, comprising:
9. the image classification model further includes a second feature extraction network; obtaining a third image feature by invoking the second feature extraction network to perform feature extraction on the second image feature; training the image classification model based on the third image feature of each disturbance image; The method of claim 8 further comprising:
10. The number of the sample images is plural, and the step of training the image classification model based on the third image feature of each of the disturbance images includes: acquiring a plurality of disturbance images obtained by performing disturbance processing on the same sample image, and determining a third difference parameter between third image features of the acquired plurality of disturbance images; obtaining a plurality of disturbance images obtained by performing disturbance processing on different sample images, and determining a fourth difference parameter between third image features of the obtained plurality of disturbance images; and training the image classification model based on the third difference parameter and the fourth difference parameter, thereby reducing the third difference parameter and increasing the fourth difference parameter obtained by calling the trained image classification model.
11. An image clustering device, comprising: a first parameter determination module that determines a first clustering parameter based on M image groups obtained using a convolutional neural network (CNN) model as an image classification model, the first clustering parameter indicating a degree of clustering of images in the M image groups, where M is an integer greater than 1; a second parameter determination module that, for one target image group among the M image groups, obtains M+1 reference image groups by dividing the target image group into two image groups, and determines a reference clustering parameter determined based on the M+1 reference image groups as a second clustering parameter of the target image group, wherein the second clustering parameter indicates the degree of clustering of images in the M+1 reference image groups; an image group division module that, when the clustering degree indicated by a target second clustering parameter is equal to or greater than the clustering degree indicated by the first clustering parameter, divides a target image group corresponding to the target second clustering parameter into two image groups to obtain M+1 image groups, wherein the target second clustering parameter is the second clustering parameter that indicates the highest clustering degree among the second clustering parameters of each of the M image groups; Including, A first parameter determination module for determining a first clustering parameter based on the M image groups, for each image in the M image groups, determine an aggregation parameter and a separation parameter corresponding to the image based on a first image feature of the image, a first image feature of other images in the image group to which the image belongs, and a first image feature of images in the other image groups, the aggregation parameter indicating a dissimilarity between the image and the other images in the image group to which the image belongs, and the separation parameter indicating a dissimilarity between the image and images in the other image groups; determining a clustering sub-parameter corresponding to the image based on the aggregation parameter and the separation parameter, wherein the clustering sub-parameter and the aggregation parameter are negatively correlated and the clustering sub-parameter and the separation parameter are positively correlated; determining the first clustering parameter based on corresponding clustering sub-parameters of each of the images in the M groups of images; The apparatus further comprising:
12. The second parameter determination module further comprises: For any one target image group among the M+1 image groups, the target image group is divided into two image groups to obtain M+2 reference image groups, and a reference clustering parameter determined based on the M+2 reference image groups is determined as a third clustering parameter of the target image group, the third clustering parameter indicating the degree of clustering of images in the M+2 reference image groups; The image group division module further divides the target image group corresponding to the target third clustering parameter into two image groups when the clustering degree indicated by the target third clustering parameter is equal to or greater than the clustering degree indicated by the target second clustering parameter, thereby obtaining M+2 image groups, the target third clustering parameter being the third clustering parameter having the highest indicated clustering degree among the third clustering parameters of each of the M+1 image groups, and determining that the image clustering process for the image group is completed when the clustering degree indicated by the target third clustering parameter is lower than the clustering degree indicated by the target second clustering parameter.
12. The apparatus of claim 11.
13. 11. A computer device comprising a processor and a memory, wherein at least one computer program is stored in the memory, and wherein the at least one computer program is loaded and executed by the processor to realize the operations performed in the image clustering method according to any one of claims 1 to 10.
14. A computer program comprising instructions which, when run on a computer, causes the computer to implement the image clustering method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Vehicle weight identification method, device and system
CN109034086A
Image management device, image management method, program and integrated circuit
JP2014093058A