WO2023016087A1 - 图像聚类方法、装置、计算机设备及存储介质 - Google Patents

图像聚类方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2023016087A1
WO2023016087A1 PCT/CN2022/099660 CN2022099660W WO2023016087A1 WO 2023016087 A1 WO2023016087 A1 WO 2023016087A1 CN 2022099660 W CN2022099660 W CN 2022099660W WO 2023016087 A1 WO2023016087 A1 WO 2023016087A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
clustering
parameter
images
target
Prior art date
Application number
PCT/CN2022/099660
Other languages
English (en)
French (fr)
Inventor
严江鹏
姚建华
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP22855072.9A priority Critical patent/EP4293631A1/en
Priority to JP2023552569A priority patent/JP2024508867A/ja
Publication of WO2023016087A1 publication Critical patent/WO2023016087A1/zh
Priority to US18/135,880 priority patent/US20230298314A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/7625Hierarchical techniques, i.e. dividing or merging patterns to obtain a tree-like representation; Dendograms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/772Determining representative reference patterns, e.g. averaging or distorting patterns; Generating dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/69Microscopic objects, e.g. biological cells or cellular parts
    • G06V20/698Matching; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/03Recognition of patterns in medical or anatomical images

Definitions

  • the embodiment of the present application relates to the technical field of artificial intelligence, and in particular to image clustering technology.
  • Image clustering is a commonly used image processing method, and image clustering is used to divide multiple images into several different categories.
  • category of the number of objects is usually determined in advance, and then a clustering algorithm is used to divide multiple images into the category of the number of objects.
  • the degree of clustering achieved by using clustering algorithms for image clustering is not high enough.
  • Embodiments of the present application provide an image clustering method, device, computer equipment, and storage medium, which can improve the clustering degree of image clustering. Described technical scheme is as follows:
  • an image clustering method executed by a computer device, the method comprising:
  • the first clustering parameter represents the clustering degree of the images in the M image groups, and the M is an integer greater than 1;
  • the target image group is divided into two image groups to obtain M+1 reference image groups, and the determined based on the M+1 reference image groups
  • the reference clustering parameter is determined as the second clustering parameter of the target image group, and the second clustering parameter represents the clustering degree of the images in the M+1 reference image groups;
  • the target second clustering parameter When the clustering degree represented by the target second clustering parameter is not lower than the clustering degree represented by the first clustering parameter, divide the target image group corresponding to the target second clustering parameter into two images group to obtain M+1 image groups; the target second clustering parameter is the second clustering parameter with the highest clustering degree represented by the second clustering parameters of the M image groups.
  • an image clustering device comprising:
  • the first parameter determination module is configured to determine a first clustering parameter based on the M image groups, the first clustering parameter represents the degree of clustering of the images in the M image groups, and the M is greater than 1 integer;
  • the second parameter determination module is configured to, for any target image group in the M image groups, divide the target image group into two image groups to obtain M+1 reference image groups, which will be based on the M
  • the reference clustering parameters determined by the +1 reference image groups are determined as the second clustering parameters of the target image group, and the second clustering parameters represent the clustering degree of the images in the M+1 reference image groups ;
  • An image group division module configured to divide the target corresponding to the second clustering parameter of the target into The image group is divided into two image groups to obtain M+1 image groups; the target second clustering parameter is the second clustering parameter with the highest clustering degree represented by the respective second clustering parameters of the M image groups. Clustering parameters.
  • a computer device in another aspect, includes a processor and a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to realize the above-mentioned The operations performed in the image clustering method described in the aspect.
  • a computer-readable storage medium wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to realize the image as described in the above aspect The operations performed in the clustering method.
  • a computer program product or computer program includes computer program code, the computer program code is stored in a computer-readable storage medium, and a processor of a computer device reads from the computer Reading the storage medium reads the computer program code, and the processor executes the computer program code, so that the computer device implements the operations performed in the image clustering method as described in the above aspect.
  • the method, device, computer equipment, and storage medium provided in the embodiments of the present application respectively determine the second clustering parameters after dividing each of the M image groups into two new image groups. If the target second cluster The clustering degree represented by the class parameter (the second clustering parameter with the highest clustering degree represented by the second clustering parameters of the M image groups) is not lower than the clustering degree represented by the first clustering parameter before division , it means that dividing the image group corresponding to the target second clustering parameter into two new image groups can improve the clustering degree of the images in the image group, so the image group is divided into two new image groups, The M+1 image groups are obtained, and the continuous subdivision of the M image groups is realized, which is beneficial to further distinguish confusing images, thereby improving the clustering degree of image clustering.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • FIG. 2 is a flow chart of an image clustering method provided in an embodiment of the present application.
  • Fig. 3 is a schematic diagram of an image classification model provided by an embodiment of the present application.
  • Fig. 4 is a schematic diagram of another image classification model provided by the embodiment of the present application.
  • FIG. 5 is a flow chart of an image clustering method provided in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a first feature extraction network provided by an embodiment of the present application.
  • FIG. 7 is a flow chart for determining clustering parameters provided by an embodiment of the present application.
  • FIG. 8 is a flow chart of a model training method provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a training image classification model provided by an embodiment of the present application.
  • Fig. 10 is a flow chart of another image clustering method provided by the embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an image clustering device provided in an embodiment of the present application.
  • Fig. 12 is a schematic structural diagram of another image clustering device provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a terminal provided in an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • the image clustering method provided in the embodiment of the present application relates to computer vision technology in the artificial intelligence technology, and the image clustering method provided in the embodiment of the present application will be described below.
  • the image clustering method provided in the embodiment of the present application can be executed by a computer device.
  • the computer device may be a terminal or a server.
  • the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for basic cloud computing services such as middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms.
  • the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • the computer programs involved in the embodiments of the present application can be deployed on one computer device for execution, or deployed on multiple computer devices located at one location, or deployed in multiple locations And it is executed on multiple computer devices interconnected through a communication network, and multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
  • the computer device in the embodiment of the present application is a node in the blockchain system, and the node can store multiple image groups obtained by clustering in the blockchain, and then the node or the block Other nodes in the blockchain can obtain the plurality of sets of images from the blockchain.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • the implementation environment includes a terminal 101 and a server 102 .
  • the terminal 101 and the server 102 are connected through a wireless or wired network.
  • the terminal 101 sends multiple images to the server 102, and the server 102 can use the method provided in the embodiment of this application to perform image clustering on the received multiple images to obtain multiple image groups, and then The server 102 returns the plurality of image groups to the terminal 101 .
  • a target application provided by the server 102 is installed on the terminal 101, and the terminal 101 may implement functions such as image processing or image transmission through the target application.
  • the target application is an image processing application, and the image processing application can perform image clustering on multiple images.
  • the server 101 is used to train the image classification model, and deploy the trained image classification model in the target application.
  • the terminal 101 runs the target application, it can call the image classification model to classify multiple images to obtain multiple image groups, and then Using the method provided in the embodiment of the present application, the multiple image groups are continuously clustered to obtain multiple image groups with a higher clustering degree.
  • FIG. 2 is a flow chart of an image clustering method provided by an embodiment of the present application.
  • the execution subject of the embodiment of the present application is a computer device, and optionally, the computer device may be the terminal or the server in the above embodiment corresponding to FIG. 1 .
  • the method includes:
  • the computer device determines a first clustering parameter based on the M image groups.
  • the computer device acquires M image groups, where M is an integer greater than 1, and each image group includes at least one image. Among them, the similarity between images belonging to the same image group is high, and the similarity between images belonging to different image groups is low, and each image group can be regarded as a cluster.
  • the computer device determines a first clustering parameter based on the M image groups, where the first clustering parameter represents a clustering degree of images in the M image groups.
  • the first clustering parameter represents a clustering degree of images in the M image groups.
  • the degree of clustering reflects the degree of cohesion between images in the same image group, and the degree of separation between images in different image groups. Wherein, the higher the cohesion degree among the images in the same image group and the higher the separation degree between the images in different image groups, the higher the clustering degree among the images in the M image groups.
  • the computer device divides the target image group into two image groups to obtain M+1 reference image groups, and set the reference aggregation determined based on the M+1 reference image groups
  • the class parameter is determined as the second clustering parameter of the target image group.
  • Each image group in the M image groups can be used as a target image group, and for any target image group in the M image groups, the computer device divides the target image group into two image groups, and combines the two image groups with M-1 image groups except the target image group among the M image groups are all used as reference image groups, and then M+1 reference image groups can be obtained.
  • 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 of the target image group, and the second clustering parameter represents the M+1 reference clustering parameters The degree of clustering of the images in the image group.
  • the computer device performs the operation in step 202 on each of the M image groups, and then the second clustering parameter of each of the M image groups can be obtained, that is, M second clustering parameters can be obtained. class parameters.
  • the computer device divides the target image group corresponding to the target second clustering parameter into two images when the clustering degree indicated by the target second clustering parameter is not lower than the clustering degree indicated by the first clustering parameter group to obtain M+1 image groups; the target second clustering parameter is the second clustering parameter with the highest clustering degree represented by the second clustering parameters of the M image groups.
  • the computer device can determine that the clustering degree represented is the highest among the obtained second clustering parameters of the M image groups
  • the second clustering parameter of is used as the target second clustering parameter.
  • the obtained images of M+1 reference image groups The degree of clustering is also the highest, that is, if one of the M image groups needs to be divided into two image groups, the target image group corresponding to the second clustering parameter of the target is divided into two image groups It can make the clustering degree of the image the highest, and this division method is the best division method.
  • the above-mentioned target second clustering parameter should be the largest second clustering parameter among the second clustering parameters of the M image groups ;
  • the above target second clustering parameter should be the smallest second clustering parameter among the second clustering parameters of the M image groups.
  • the computer device compares the clustering degree represented by the second clustering parameter of the target with the clustering degree represented by the first clustering parameter, and the clustering degree represented by the second clustering parameter of the target is not lower than that represented by the first clustering parameter In the case of the degree of clustering, after the target image group corresponding to the second clustering parameter of the target is divided into two image groups, the degree of clustering of the images is not lower than the degree of clustering of the images of the original M image groups, so the computer The device divides the target image group corresponding to the target second clustering parameter into two image groups to obtain M+1 image groups.
  • the target image group corresponding to the target second clustering parameter is divided into two After the number of image groups, if the clustering degree of the images is lower than that of the original M image groups, the computer device will no longer divide the image groups in the M image groups.
  • the method provided in the embodiment of the present application respectively determines the second clustering parameter after dividing each of the M image groups into two new image groups. If the clustering degree represented by the target second clustering parameter is not is less than the clustering degree represented by the first clustering parameter before division, it means that the image group corresponding to the target second clustering parameter is divided into two new image groups, which can improve the clustering degree of the images in the image group, Therefore, the image group is divided into two new image groups, and M+1 image groups are obtained, which realizes the continuous subdivision of M image groups, which is conducive to further distinguishing confusing images, thereby improving the clustering efficiency of image clustering. class level.
  • the M image groups are divided according to the classification results of the multiple images by the image classification model, and the image classification model is used to classify the images to obtain the category labels of the images.
  • Fig. 3 is a schematic diagram of an image classification model provided by the embodiment of the present application. As shown in Fig. 3, the image classification model 30 includes a first feature extraction network 301 and an image classification network 302, and the first feature extraction network 301 and the image classification network 302 is connected, the first feature extraction network 301 is used to perform feature extraction on images, and the image classification network 302 is used to perform classification processing based on image features.
  • the image classification model 30 further includes a second feature extraction network 303, the second feature extraction network 303 is connected to the first feature extraction network 301, and the second feature extraction network 303 is used for Continue to perform feature extraction on the image features extracted by the first feature extraction network 301 .
  • Fig. 5 is a flow chart of an image clustering method provided by an embodiment of the present application.
  • the execution subject of the embodiment of the present application is a computer device, and optionally, the computer device may be the terminal or the server in the above embodiment corresponding to FIG. 1 .
  • the method includes:
  • a computer device acquires multiple images obtained by shooting a target object.
  • the computer device acquires multiple images, and the multiple images are all obtained by shooting the same target object.
  • the target object is a human body
  • the multiple images may be obtained by photographing different organs of the same human body; or, if the target object is an organ, the multiple images may be obtained by photographing different parts of the same organ; or the target object
  • the object is a scene, and the multiple images may be obtained by shooting the same scene at different time points.
  • the plurality of images may be digital pathological panoramic images (Whole Slide Images, WSIs), and digital pathological panoramic images are images obtained by scanning pathological microsections by a digital pathological scanner.
  • the scanner is composed of optical system, line scan camera and other components.
  • the computer device invokes the image classification model to perform classification processing on multiple images respectively to obtain a category label of each image.
  • An image classification model is stored in the computer device, and the image classification model is used to classify images.
  • the image classification model can be a convolutional neural network model (Convolutional Neural Network, CNN), and the network of the image classification model
  • CNN convolutional Neural Network
  • the computer device After the computer device acquires multiple images, it invokes the image classification model to perform classification processing on each of the multiple images to obtain a category label of each image, and the category label of the image can indicate the category to which the image belongs.
  • the image classification model includes a first feature extraction network and an image classification network, and the first feature extraction network is connected to the image classification network.
  • the computer device invokes the first feature extraction network, extracts the features of the image, obtains the first image features, invokes the image classification network, performs classification processing based on the first image features, and obtains the category label of the image .
  • the input of the first feature extraction network is an image
  • the input of the image classification network is the output of the first feature extraction network.
  • the image classification network is a neural network composed of two fully connected layers.
  • the first image feature output by the first feature extraction network is used to represent the feature of the image, for example, the first image feature is a multi-dimensional feature vector matrix, or the first image feature is an image used to represent a feature.
  • the image is a pathological slice image
  • the first feature extraction network includes K feature extraction layers and a feature conversion layer
  • the feature extraction layer is used to extract image features
  • the feature conversion layer is used to convert image features .
  • the computer equipment calls K feature extraction layers, performs feature extraction on the image in turn, obtains the image features output by each feature extraction layer, calls the feature conversion layer, performs feature conversion on the image features output by the last L feature extraction layers, and obtains the first Image features
  • L is an integer greater than 1 and not greater than K.
  • K feature extraction layers are connected sequentially, and the feature conversion layer is respectively connected to the last L feature extraction layers.
  • the K feature extraction layers sequentially extract the image features from the shallow layer to the deep layer.
  • the classification of pathological slice images is more dependent on the morphological information of the nucleus and the texture information of the distribution in the image, And this information needs to be obtained from the image features extracted by the shallow network. Therefore, when performing feature conversion, it is not only the image features output by the last feature extraction layer, but the image output by the last L feature extraction layers.
  • feature conversion so that the final first image features not only include the deep image features output by the last feature extraction layer, but also include the relatively shallow image features output by the feature extraction layer before the last feature extraction layer, thereby improving Feature extraction ability of the first feature extraction network for pathological slice images.
  • the feature extraction layer in the first feature extraction network is a convolutional layer
  • the feature conversion layer is a fully connected layer
  • a pooling layer is also connected between the last L feature extraction layers and the feature conversion layer, and the pooling layer It is used to pool the image features extracted by the feature extraction layer.
  • the first feature extraction network includes convolutional layer 601-convolutional layer 604 and fully connected layer 605, and the last three convolutional layers (ie convolutional layer 602-convolutional layer 604) and fully connected layer 605 There are also pooling layers connected therebetween, and the computer equipment inputs pathological slice images into the convolutional layer 601 of the first feature extraction network, and the image features output by the convolutional layer 601 are input into the convolutional layer 602, and the convolutional layer 602
  • the output image features are input to the convolutional layer 603 and the pooling layer 612 respectively, the image features output by the convolutional layer 603 are respectively input to the convolutional layer 604 and the pooling layer 613, and the image features output by the convolutional layer 604 are input to the pooling Layer 614.
  • the image features output by the pooling layer 612, the pooling layer 613 and the pooling layer 614 are all input to the fully connected layer 605, and the fully connected layer 605 performs feature conversion on the image features output by the three pooling layers to obtain the first image features.
  • the convolutional layer in the first feature extraction network may be composed of network structures such as a residual neural network, GoogleNet (a neural network) or VGGnet (Visual Geometry Group Network, Visual Geometry Group Network).
  • GoogleNet a neural network
  • VGGnet Visual Geometry Group Network, Visual Geometry Group Network
  • the computer device Based on the category label of each image, the computer device divides images of the same category into the same image group to obtain M image groups.
  • the computer device After the computer device obtains the category label of each image, it can determine the category to which each image belongs based on the category label of each image.
  • the computer device divides images of the same category into the same image group to obtain M image groups, where M is an integer greater than 1.
  • Each image group includes at least one image, images belonging to the same image group belong to the same category, and the similarity between these images is high, and images belonging to different image groups belong to different categories, and the similarity between these images is low.
  • each image group may be a cluster.
  • the category label of the image includes the probability that the image belongs to each category, and for each image, the category corresponding to the maximum probability among the category labels of the image is determined as the category to which the image belongs.
  • the computer device first determines the category to which each image belongs through the image classification model, and then divides the multiple images into M image groups according to the category to which each image belongs,
  • the category label output by the image classification model includes the probability of K categories
  • M must not be greater than K, which is equivalent to limiting the clustering of multiple images Therefore, there may be a case where the degree of aggregation among the images in the same image group is not high enough, resulting in that the degree of clustering of the images in the M image groups is not high enough. Therefore, the computer device needs to continue to execute the following steps 504-508 to further divide the M image groups.
  • the computer device determines a first clustering parameter based on the M image groups.
  • the computer device determines a first clustering parameter based on the M image groups, where the first clustering parameter represents a clustering degree of images in the M image groups.
  • the first clustering parameter represents a clustering degree of images in the M image groups.
  • the degree of clustering reflects the degree of cohesion between images in the same image group, and the degree of separation between images in different image groups. Wherein, the higher the cohesion degree among the images in the same image group and the higher the separation degree between the images in different image groups, the higher the clustering degree among the images in the M image groups.
  • the computer device determines the first clustering parameters based on the first image features of the images in each of the M image groups, as shown in FIG. 7 , including the following steps:
  • the computer device For each image in the M image groups, the computer device based on the first image feature of the image, the first image features of other images in the image group to which the image belongs, and the first image features of the images in other image groups Image features, determining the cohesion parameters and separation parameters corresponding to the image.
  • the aggregation parameter represents the degree of dissimilarity between the image and other images in the image group to which the image belongs
  • the separation parameter represents the degree of dissimilarity between the image and images in other image groups.
  • the computer device determines an aggregation parameter corresponding to the image based on the first image feature of the image and the first image features of other images in the image group to which the image belongs.
  • the computer device determines a separation parameter corresponding to the image based on the first image feature of the image and the first image features of images in other image groups except the image group to which the image belongs.
  • the computer device may determine a candidate separation parameter between the image and the other image group based on the first image feature of the image and the first image features of the images in the other image . Therefore, the smallest candidate separation parameter between the image and each other image group is determined, and the smallest candidate separation parameter is determined as the separation parameter corresponding to the image.
  • the computer device may determine the distance between the image and each other image based on the first image feature of the image and the first image features of other images in the image group to which the image belongs, and then compare the image with each The mean value of the distances between other images is determined as the cohesion parameter corresponding to this image.
  • the computer device may determine that the image is different from each of the other group of images based on the first image feature of the image and the first image feature of each image in the other group of images.
  • the distance between the images, and then the average value of the distances between the image and multiple images in other image groups is determined as the candidate separation parameter between the image and the other image groups; and then, between the image and each other Among the candidate separation parameters between the image groups, the smallest candidate separation parameter is determined as the corresponding separation parameter of the image.
  • the larger the distance between the image and the images in other image groups the lower the similarity between the image and the images in other image groups, and the larger the separation parameter corresponding to this image.
  • the larger the separation parameter corresponding to the image the higher the degree of dissimilarity between the image and the images in other image groups, and the higher the clustering degree of the image group.
  • the distance between images may be a cosine distance or a Euclidean distance, etc., which is not limited in this embodiment of the present application.
  • the computer device determines a clustering sub-parameter corresponding to the image based on the aggregation parameter and the separation parameter. Among them, the clustering sub-parameter is negatively correlated with the cohesion parameter, and the clustering sub-parameter is positively correlated with the separation parameter.
  • the computer device uses the following formula to determine the clustering sub-parameters corresponding to the image:
  • i represents the image
  • SC(i) represents the clustering sub-parameter corresponding to the image
  • a(i) represents the aggregation parameter corresponding to the image
  • b(i) represents the separation parameter corresponding to the image.
  • the computer device determines a first clustering parameter based on the clustering sub-parameters corresponding to each image in the M image groups.
  • the computer device determines the clustering sub-parameters corresponding to each image, and determines the first clustering parameter based on the clustering sub-parameters corresponding to each image.
  • the computer device determines the mean value of the clustering sub-parameters corresponding to each image as the first clustering parameter.
  • the computer device divides the target image group into two image groups to obtain M+1 reference image groups, and set the reference aggregation determined based on the M+1 reference image groups
  • the class parameter is determined as the second clustering parameter of the target image group.
  • Each image group in the M image groups can be used as the target image group.
  • the computer device divides the target image group into two image groups, and will be based on M+1 reference
  • the reference clustering parameter determined by the image group is determined as the second clustering parameter of the target image group, and the second clustering parameter represents the clustering degree of the images in the M+1 reference image groups.
  • the computer device performs the operation in step 202 on each of the M image groups, and then the second clustering parameter of each of the M image groups can be obtained, that is, M second clustering parameters can be obtained. Clustering parameters.
  • M is 3, and the M image groups include image group 1, image group 2, and image group 3.
  • the computer device divides the image group 1 into an image group 11 and an image group 12, and based on the image group 11, the image group 12, the image group 2 and the image group 3, the second clustering parameter a is determined.
  • the computer device divides the image group 2 into an image group 21 and an image group 22, and based on the image group 1, the image group 21, the image group 22 and the image group 3, the second clustering parameter b is determined.
  • the computer device divides the image group 3 into image group 31 and image group 32, and determines the second clustering parameter c based on image group 1, image group 2, image group 31 and image group 32, thereby obtaining three second clustering parameters , that is, 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.
  • the computer device adopts any clustering algorithm such as spectral clustering algorithm, k-means algorithm (an unsupervised clustering algorithm) or a maximum expectation clustering algorithm based on GMM (Gaussian Mixed Model, Gaussian mixture model) , divide the target image group into two new image groups.
  • clustering algorithm such as spectral clustering algorithm, k-means algorithm (an unsupervised clustering algorithm) or a maximum expectation clustering algorithm based on GMM (Gaussian Mixed Model, Gaussian mixture model) , divide the target image group into two new image groups.
  • the computer device divides the target image group corresponding to the target second clustering parameter into two images when the clustering degree indicated by the target second clustering parameter is not lower than the clustering degree indicated by the first clustering parameter group to obtain M+1 image groups; the target second clustering parameter is the second clustering parameter with the highest clustering degree represented by the second clustering parameters of the M image groups.
  • the computer device can determine that the clustering degree represented is the highest among the obtained second clustering parameters of the M image groups After dividing the target image group corresponding to the target second clustering parameter into two image groups, the images of M+1 reference image groups obtained have the highest clustering degree.
  • the computer device compares the clustering degree represented by the second clustering parameter of the target with the clustering degree represented by the first clustering parameter, and the clustering degree represented by the second clustering parameter of the target is not lower than that represented by the first clustering parameter In the case of the degree of clustering, after the target image group corresponding to the second clustering parameter of the target is divided into two image groups, the degree of clustering of the images is not lower than the degree of clustering of the images of the original M image groups, so the computer The device divides the target image group corresponding to the target second clustering parameter into two image groups to obtain M+1 image groups.
  • the target image group corresponding to the target second clustering parameter is divided into two After the 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 divide the image groups in the M image groups, and there is no need to perform the following step 507- 508.
  • the computer device continues to divide the target image group into two image groups to obtain M+2 reference image groups, which will be determined based on the M+2 reference image groups
  • the reference clustering parameter of is determined as the third clustering parameter of the target image group.
  • the computer equipment After the computer equipment obtains M+1 image groups, for any target image group in the M+1 image groups, continue to divide the target image group into two image groups to obtain M+2 reference image groups, based on The reference clustering parameter determined by the M+2 reference image groups is determined as the third clustering parameter of the target image group, where the third clustering parameter represents the clustering degree of the M+2 reference image groups.
  • the computer device performs the operation in step 507 on each of the M+1 image groups, and then the third clustering parameter of each of the M+1 image groups can be obtained, that is, M+1 third clustering parameters.
  • the process of determining the third clustering parameter in step 507 is the same as the process of determining the second clustering parameter in step 505 above, and will not be repeated here.
  • the computer device divides the target image group corresponding to the target third clustering parameter into two when the clustering degree indicated by the target third clustering parameter is not lower than the clustering degree indicated by the target second clustering parameter Image group, M+2 image groups are obtained until the largest clustering parameter among multiple clustering parameters obtained after the current round of division is smaller than the clustering parameter before division.
  • step 508 The process for the computer device to obtain M+2 image groups in step 508 is the same as the process for obtaining M+1 image groups in step 506 above, and will not be repeated here.
  • the computer device After the computer device obtains the M+2 image groups, it continues to divide any target image group in the M+2 image groups, and re-determines the clustering parameters, and then determines whether the M The +2 image groups are further divided into M+3 image groups. That is, the computer device executes multiple iterations, and the above steps 505-506 and steps 507-508 are one iteration.
  • the clustering parameter represented by the target clustering parameter that is, the clustering parameter with the highest degree of clustering obtained after the current round of division
  • the degree of clustering is lower than the clustering degree indicated by the target clustering parameter before division (that is, the clustering parameter with the highest clustering degree obtained after the last round of division), which means that after dividing any current image group
  • the degree of clustering is lower than the degree of clustering before division, so the computer device stops the iterative process and completes the further division of the M image groups.
  • two processes are included.
  • One is to perform image clustering based on the image classification model.
  • For multiple images without category labels use an end-to-end image classification model to process them to obtain the category label of each image, so that Realize preliminary image clustering; the other is to perform image clustering based on clustering parameters.
  • the current multiple image groups are further divided to distinguish image groups with tighter distribution until the division If the clustering degree represented by the clustering parameters after the division is lower than the clustering degree represented by the clustering parameters before division, the further division of the image group is terminated to obtain the final clustering result.
  • the method provided in the embodiment of the present application respectively determines the second clustering parameter after each image group in the M image groups is divided into two new image groups, if the target second clustering parameter (represented clustering The clustering degree represented by the second clustering parameter with the highest degree) is not lower than the clustering degree represented by the first clustering parameter before division, which means that the image group corresponding to the target second clustering parameter is divided into two new
  • the image group can improve the clustering degree of the images in the image group, so the image group is divided into two new image groups, and M+1 image groups are obtained, which realizes the continuous subdivision of the M image groups, It is beneficial to further distinguish confusing images, thereby improving the clustering degree of image clustering.
  • the image classification model is called first to determine the category labels of multiple images, and the multiple images are divided into M image groups based on the category labels to realize preliminary image clustering for multiple images, and then the M images are grouped based on the clustering parameters The group continues to be subdivided to achieve more accurate image clustering for multiple images.
  • the combination of the two methods can not only improve the efficiency of image clustering, but also improve the clustering degree of image clustering.
  • feature conversion is performed on the image features output by the last L feature extraction layers, so that the final first image features not only include the deep image features output by the last feature extraction layer, but also include the feature extraction before the last feature extraction layer
  • the relatively shallow image features output by the layer can improve the feature extraction ability of the first feature extraction network for pathological slice images.
  • FIG. 8 is a flow chart of a model training method provided in the embodiment of the present application.
  • the image classification model trained in the embodiment of the present application can be applied to the embodiment shown in FIG. 5 above.
  • the execution body of the method is a computer device, and optionally, the computer device may be the terminal or the server in the above embodiment corresponding to FIG. 1 .
  • the method comprises the following steps:
  • a computer device acquires a sample image.
  • the sample image may be any type of image, and may be a sample image acquired in any manner.
  • the computer device acquires multiple pathological slice images of different organs of different human bodies, divides each pathological slice image into multiple image blocks of the same size, and uses the multiple image blocks obtained by switching as sample images.
  • the sample images in the embodiment of the present application are images without real category labels
  • the training method in the embodiment of the present application is a training method of unsupervised learning based on unlabeled sample images.
  • the computer device performs perturbation processing on the sample images in different ways to obtain multiple perturbed images.
  • the computer equipment uses disturbance processing to enhance the randomness of the sample image.
  • the computer equipment uses different methods to perturb the sample image to obtain multiple different perturbed images.
  • different disturbance processing methods may include different disturbance types, and the disturbance types include color dithering, Gaussian blur, rotation, cropping a part of the area and then zooming in to the original size, etc.
  • Each disturbance treatment may include only one disturbance type, or may include multiple disturbance types.
  • each time the sample image is disturbed multiple disturbance types are traversed.
  • the computer device determines whether to select the disturbance type this time according to the occurrence probability of the disturbance type. If it is , then perform disturbance processing according to the disturbance type, and continue to traverse the next disturbance type.
  • the computer device continues to perform another perturbation process on the sample image according to the above steps to obtain another perturbation image.
  • the occurrence probability of each disturbance type can be set to 0.5 in order to enhance the randomness of the disturbance image.
  • the computer equipment selects multiple disturbance types according to the occurrence probability of each disturbance mode, and perturbs the two sample images respectively according to the multiple disturbance types selected this time. After processing, two perturbed images are obtained. Then the computer equipment again selects multiple disturbance types according to the occurrence probability of each disturbance mode, and performs disturbance processing on the two sample images respectively according to the various disturbance types selected this time, and obtains two disturbance images again. Then the computer device finally obtains 4 perturbed images.
  • the computer device invokes the image classification model to be trained, and performs classification processing on each disturbed image respectively, to obtain a category label of each disturbed image.
  • the image classification model includes a first feature extraction network and an image classification network.
  • the computer device invokes the first feature extraction network to perform feature extraction on the disturbed image to obtain second image features, and invokes the image classification network to perform classification processing based on the second image features to obtain category labels of the disturbed image.
  • the category label is a pseudo-label predicted by the image classification model, rather than the real category label of the perturbed image.
  • the image classification model further includes a second feature extraction network.
  • the computer device After the computer device obtains the second image features, it will also call the second feature extraction network to perform feature extraction on the second image features to obtain the third image features.
  • the second feature extraction network is connected to the first feature extraction network, and both the first feature extraction network and the second feature extraction network are used to extract image features, the difference is that the first feature extraction network extracts the features of the image , the second feature extraction network extracts the features of image features, compared with the first image features extracted by the first feature extraction network, the second image features extracted by the second feature extraction network are deeper features.
  • the third image feature in the embodiment of the present application can be used to train the image classification model. For the process of using the third image feature to train the image classification model, refer to the following step 804 for details, which will not be described here.
  • the process of acquiring the second image feature and the category label of the disturbed image in step 803 is the same as the process of acquiring the first image feature and the category label of the image in step 502 above, and will not be repeated here.
  • the computer device trains an image classification model based on the category label of each perturbed image.
  • an image classification model is trained based on the category label of each disturbance image, so as to improve the classification ability of the image classification model.
  • the trained image classification model can classify any given image to obtain the category label of the image.
  • the category label includes the 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.
  • the category label of the perturbed image includes the probability that the perturbed image belongs to each category.
  • the computer device acquires multiple perturbed images obtained by performing perturbation processing on the same sample image, determines a first difference parameter between the probabilities that the obtained multiple perturbed images belong to the same category, and obtains multiple perturbed images obtained by performing perturbation processing on different sample images. Perturb the image, determine the second difference parameter between the probabilities that the obtained multiple disturbed images belong to the same category, and train the image classification model based on the first difference parameter and the second difference parameter, so that the trained image classification model is called to obtain The first difference parameter of is decreased, and the second difference parameter is increased.
  • the categories to which the multiple perturbed images belong should be the same as the category to which the sample image belongs , that is, the categories to which the multiple images belong are also the same.
  • the category label of the perturbed image is predicted by the image classification model. If the accuracy of the image classification model is high enough, then for each category, the probability that the multiple perturbed images belong to the category should be close enough.
  • the computer device determines the first difference parameter between the probabilities of the plurality of perturbed images belonging to the same category, the smaller the first difference parameter, the closer the probabilities of the multiple perturbed images belonging to the same category, and the more accurate the image classification model , so the computer device trains the image classification model based on the first difference parameter, so that the first difference parameter is reduced, thereby improving the classification ability of the image classification model.
  • the categories to which the multiple perturbed images belong are the same as the categories to which different sample images belong , that is, the categories to which the multiple images belong are different.
  • the category label of the perturbed image is predicted by the image classification model. If the accuracy of the image classification model is high enough, then for each category, the difference in the probability that the multiple perturbed images belong to the category should be large enough.
  • the computer device determines a second difference parameter between the probabilities of the plurality of perturbed images belonging to the same category, the larger the second difference parameter, the greater the difference between the probabilities of the plurality of perturbed images belonging to the same category, and the image
  • the classification model is more accurate, so the computer equipment trains the image classification model based on the second difference parameter, so that the second difference parameter increases, thereby improving the classification ability of the image classification model.
  • the image classification model further includes a second feature extraction network.
  • the computer device after the computer device obtains the second image features, it also calls the second feature extraction network to perform feature extraction to obtain the third image feature. Then the computer device can also train an image classification model based on the third image feature of each perturbed image.
  • the process of training the image classification model based on the third image feature of each disturbed image includes: the computer device acquires multiple disturbed images obtained by performing disturbance processing on the same sample image, Determine a third difference parameter between the third image features of the obtained multiple disturbed images, acquire multiple disturbed images obtained by performing disturbance processing on different sample images, and determine the third difference parameter between the obtained multiple disturbed images.
  • the fourth difference parameter between, based on the third difference parameter and the fourth difference parameter, train the image classification model, so that the third difference parameter obtained by calling the trained image classification model decreases, and the fourth difference parameter increases.
  • the image features of the multiple perturbed images are similar to the image features of the sample image, That is, the image features of the plurality of images are also similar. If the accuracy of the image classification model is high enough, the image features of each perturbed image extracted by the image classification model should be close enough.
  • the computer device determines a third difference parameter between the third image features of the plurality of disturbance images, the smaller the third difference parameter is, the closer the third image features of the plurality of disturbance images are, and the more accurate the image classification model is , so the computer device trains the image classification model based on the third difference parameter, so that the third difference parameter is reduced, thereby improving the classification ability of the image classification model.
  • the image features of the multiple perturbed images are similar to the image features of different sample images , that is, the image features of the multiple images are not similar. If the accuracy of the image classification model is high enough, the difference in the image features of each perturbed image extracted by the image classification model should be large enough.
  • the computer device determines a fourth difference parameter between the third image features of the plurality of disturbed images, the larger the fourth difference parameter is, the larger the difference between the third image features of the plurality of disturbed images is, and the image
  • the classification model is more accurate, so the computer equipment trains the image classification model based on the fourth difference parameter, so that the fourth difference parameter increases, thereby improving the classification ability of the image classification model.
  • the computer device determines the first loss value based on the first difference parameter and the second difference parameter, determines the second loss value based on the third difference parameter and the fourth difference parameter, and weights the first loss value and the second loss value Sum to get the target loss value.
  • the computer device trains the image classification model based on the target loss value, so that the target loss value obtained by calling the trained image classification model is reduced.
  • the first loss value is positively correlated with the first difference parameter, and the first loss value is negatively correlated with the second difference parameter, that is, the larger the first difference parameter is, the larger the first loss value is, and the smaller the first difference parameter is , the smaller the first loss value is, the larger the second difference parameter is, and the smaller the first loss value is, the smaller the second difference parameter is, and the larger the first loss value is.
  • the second loss value is positively correlated with the third difference parameter
  • the third loss value is negatively correlated with the fourth difference parameter, that is, the larger the third difference parameter is, the larger the second loss value is, and the smaller the third difference parameter is.
  • the weight coefficients corresponding to the first loss value and the second loss value are both 0.5.
  • the feature extraction capability of the image classification model and the ability of different types of images are improved. resolution.
  • the unsupervised training of the image classification model is realized without manually labeling the sample images, which is beneficial to save manpower and time, and can avoid the wrong labels caused by manual labeling, thus improving the performance of the image classification model training efficiency and accuracy.
  • the process of training the image classification model in the embodiment of the present application is unsupervised training, there is no real sample category label in the training process, and the image classification model can only determine the probability that the image belongs to each category, but cannot Determine what each category really means.
  • the computer device does not need to determine the true meaning of each category, and only needs to use the image classification model to divide the multiple images into different categories.
  • the image classification model can divide pathological slice images into seven categories, each category represents a type of physiological tissue, and then the doctor determines the type of physiological tissue represented by each category according to the division results.
  • the computer device stops training the image classification model in response to the iteration round reaching the first threshold; or, in response to the loss value obtained in the current iteration round is not greater than the second threshold, stops training the image The classification model is trained.
  • both the first threshold and the second threshold can be set according to actual needs, for example, the first threshold is 10 or 15, and the second threshold is 0.01 or 0.02.
  • the training image classification model includes the following contents:
  • Both the total number of iterations E and the number N of sample images are integers, for example, E is greater than 100, and N is greater than 128.
  • the first feature extraction network f ⁇ is a neural network
  • the input is a 224*224*3-dimensional sample image
  • the output is a 512*1-dimensional image feature.
  • the second feature extraction network and image classification network Then the image features output by the first feature extraction network f ⁇ are further projected into different spaces, so as to perform contrastive learning optimization of features and contrastive learning optimization of categories respectively.
  • the second feature extraction network The input is a 512*1-dimensional image feature
  • the output is a 128*1-dimensional image feature
  • the image classification network The input is a 512*1-dimensional image feature
  • the output is an M*1-dimensional category label.
  • the second feature extraction network It is a neural network composed of two fully connected layers, the input is 512*1 dimension, the middle layer is 512*1 dimension, and the output is 128*1 dimension.
  • Image classification network It is a neural network composed of two layers of fully connected layers, the input is 512*1 dimensions, the middle layer is 512*1 dimensions, and the output is M*1 dimensions.
  • FIG. 9 is a schematic diagram of a training image classification model provided by the embodiment of the present application.
  • sample image a and sample image b are obtained from the sample image set , after the sample image a and the sample image b are perturbed in different ways, the perturbed image a', the perturbed image b', the perturbed image a" and the perturbed image b" are obtained.
  • the computer device performs comparative learning and optimization of feature dimensions based on the image features output by the second feature extraction network 902 , and performs comparative learning and optimization of category dimensions based on the category labels output by the image classification network 903 .
  • the method provided in the embodiment of the present application improves the feature extraction ability of the image classification model and the classification of different categories by performing comparative learning based on perturbed images from the same sample image and by performing comparative learning based on perturbed images from different sample images. image resolution.
  • the unsupervised training of the image classification model is realized without manually labeling the sample images, which is beneficial to save manpower and time, and can avoid the wrong labels caused by manual labeling, thus improving the performance of the image classification model training efficiency and accuracy.
  • Fig. 10 is a flow chart of an image clustering method provided by an embodiment of the present application. Referring to Fig. 10, the method includes:
  • the embodiment of the present application can perform image clustering on unlabeled pathological slice image blocks, divide multiple pathological slice image blocks into multiple image groups, and each image group represents a physiological tissue, thereby providing support for subsequent pathological analysis tasks .
  • pathological analysis tasks include: abnormal prediction or prognosis processing based on the proportion of physiological tissues; comparing a tissue image group with normal tissue image groups to determine whether the tissue is abnormal, etc., each image group corresponds to a a physiological tissue.
  • image clustering may also be performed on pathological slice images according to other criteria.
  • image clustering is performed on pathological slice images according to quality categories, such as uneven staining, slice thickness, knife vibration, or wrinkled slices.
  • image clustering on pathological slice images according to cell categories for example, cell categories include suspicious cells and normal cells.
  • Fig. 11 is a schematic structural diagram of an image clustering device provided by an embodiment of the present application. Referring to Figure 11, the device includes:
  • the first parameter determination module 1101 is configured to determine a first clustering parameter based on the M image groups, the first clustering parameter indicates the degree of clustering of the images in the M image groups, and M is an integer greater than 1;
  • the second parameter determination module 1102 is configured to, for any target image group in the M image groups, divide the target image group into two image groups to obtain M+1 reference image groups, which will be based on the M+1 reference images
  • the reference clustering parameter determined by the group is determined as the second clustering parameter of the target image group, and the second clustering parameter represents the clustering degree of the images in the M+1 reference image groups;
  • An image group division module 1103, configured to divide the target image group corresponding to the target second clustering parameter into into two image groups to obtain M+1 image groups; the target second clustering parameter is the second clustering parameter with the highest clustering degree represented by the second clustering parameters of the M image groups.
  • the image clustering device provided in the embodiment of the present application respectively determines the second clustering parameter after dividing each of the M image groups into two new image groups, if the target second clustering parameter represents the clustering If the degree of clustering is not lower than the degree of clustering represented by the first clustering parameter before the division, it means that the image group corresponding to the second clustering parameter of the target is divided into two new image groups, which can improve the accuracy of the images in the image group.
  • the degree of clustering so the image group is divided into two new image groups, and M+1 image groups are obtained, which realizes the continuous subdivision of M image groups, which is conducive to further distinguishing confusing images, thereby improving image quality.
  • the degree of clustering of the clusters are provided in the embodiment of the present application respectively determines the second clustering parameter after dividing each of the M image groups into two new image groups, if the target second clustering parameter represents the clustering If the degree of clustering is not lower than the degree of clustering represented by the first clustering parameter before the division, it means that the image group
  • the second parameter determination module 1102 is also used for:
  • the target image group is divided into two image groups to obtain M+2 reference image groups, and the reference clustering parameters determined based on the M+2 reference image groups Determined as the third clustering parameter of the target image group, the third clustering parameter represents the clustering degree of the images in the M+2 reference image groups;
  • the image group division module 1103 is further configured to divide the target image corresponding to the target third clustering parameter into The group is divided into two image groups to obtain M+2 image groups; the target third clustering parameter is the third clustering parameter with the highest clustering degree represented by the respective third clustering parameters of the M+1 image groups and, in the case that the clustering degree indicated by the target third clustering parameter is lower than the clustering degree indicated by the target second clustering parameter, determine to complete the image clustering process for the image group.
  • the device further includes:
  • An image acquisition module 1104 configured to acquire a plurality of images obtained by shooting the target object
  • the classification processing module 1105 is used to call the image classification model to classify multiple images respectively to obtain the category label of each image;
  • the image division module 1106 is configured to divide images of the same category into the same image group based on the respective category labels of the multiple images to obtain M image groups.
  • the image classification model includes a first feature extraction network and an image classification network
  • the classification processing module 1105 includes:
  • the first feature extraction unit 1115 is configured to call the first feature extraction network for each of the multiple images to perform feature extraction on the image to obtain the first image feature;
  • the classification processing unit 1125 is configured to call the image classification network, perform classification processing based on the first image feature, and obtain the category label of the image.
  • the first parameter determination module 1101 includes:
  • the first parameter determination unit 1111 is configured to, for each image in the M image groups, based on the first image feature of the image, the first image features of other images in the image group to which the image belongs, and the images in other image groups
  • the first image feature of the image determines the agglomeration parameter and separation parameter corresponding to the image.
  • the agglomeration parameter indicates the degree of dissimilarity between the image and other images in the image group to which the image belongs
  • the separation parameter indicates the degree of dissimilarity between the image and other images in the image group. degree of dissimilarity;
  • the second parameter determination unit 1121 is configured to determine a clustering sub-parameter corresponding to the image based on the aggregation parameter and the separation parameter, the clustering sub-parameter is negatively correlated with the aggregation parameter, and the clustering sub-parameter is positively correlated with the separation parameter.
  • the third parameter determining unit 1131 is configured to determine a first clustering parameter based on the clustering sub-parameters corresponding to each image in the M image groups.
  • the image is a pathological slice image
  • the first feature extraction network includes K feature extraction layers and feature conversion layers
  • the first feature extraction unit 1115 is used for:
  • the device further includes:
  • a sample image acquisition module 1107 configured to acquire a sample image
  • a disturbance processing module 1108, configured to perform disturbance processing on the sample image in different ways to obtain multiple disturbance images
  • the classification processing module 1105 is also used to call the image classification model to be trained to classify each disturbed image to obtain the category label of each disturbed image;
  • a model training module 1109 configured to train an image classification model based on the category label of each perturbed image.
  • the model training module 1109 includes:
  • the first difference parameter determining unit 1119 is configured to acquire multiple perturbed images obtained by performing perturbation processing on the same sample image, and determine a first difference parameter between probabilities that the acquired multiple perturbed images belong to the same category;
  • the second difference parameter determining unit 1129 is configured to acquire a plurality of disturbed images obtained by performing disturbance processing on different sample images, and determine a second difference parameter between the probabilities that the obtained multiple disturbed images belong to the same category;
  • the first model training unit 1139 is configured to train the image classification model based on the first difference parameter and the second difference parameter, so that the first difference parameter obtained by calling the trained image classification model is reduced, and the second difference parameter is increased .
  • the image classification model includes a first feature extraction network and an image classification network
  • the classification processing module 1105 includes:
  • the first feature extraction unit 1115 is configured to call the first feature extraction network for each disturbed image, perform feature extraction on the disturbed image, and obtain second image features;
  • the classification processing unit 1125 is configured to call the image classification network to perform classification processing based on the second image feature, and obtain a category label of the disturbed image.
  • the image classification model also includes a second feature extraction network, a classification processing module 1105, which also includes:
  • the second feature extraction unit 1135 is used to call the second feature extraction network to perform feature extraction on the second image feature to obtain the third image feature;
  • Model training module 1109 comprising:
  • the second model training unit 1149 is configured to train an image classification model based on the third image feature of each disturbed image.
  • the number of sample images is multiple, and the second model training unit 1149 is used for:
  • the image classification model is trained, so that the third difference parameter obtained by calling the trained image classification model decreases, and the fourth difference parameter increases.
  • the image clustering device provided in the above-mentioned embodiments performs image clustering
  • the division of the above-mentioned functional modules is used as an example for illustration.
  • the above-mentioned functions can be assigned to different functional modules according to needs.
  • To complete means to divide the internal structure of the computer device into different functional modules, so as to complete all or part of the functions described above.
  • the image clustering device and the image clustering method embodiments provided in the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
  • the embodiment of the present application also provides a computer device, the computer device includes a processor and a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor, so as to realize the image aggregation in the above embodiment The operation performed in the class method.
  • Fig. 13 shows a schematic structural diagram of a terminal 1300 provided by an exemplary embodiment of the present application.
  • the terminal 1300 includes: a processor 1301 and a memory 1302 .
  • the processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like.
  • the processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing, digital signal processing), FPGA (Field Programmable Gate Array, field programmable gate array), and PLA (Programmable Logic Array, programmable logic array).
  • Processor 1301 may also include a main processor and a coprocessor, the main processor is a processor for processing data in a wake-up state, and is also called a CPU (Central Processing Unit, central processing unit); the coprocessor is Low-power processor for processing data in standby state.
  • the processor 1301 may be integrated with a GPU (Graphics Processing Unit, an image processing interactor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen.
  • the processor 1301 may also include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence, artificial intelligence
  • Memory 1302 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one computer program, and the at least one computer program is used to be possessed by the processor 1301 to implement the methods provided by the method embodiments in this application. Image clustering methods.
  • the terminal 1300 may optionally further include: a peripheral device interface 1303 and at least one peripheral device.
  • the processor 1301, the memory 1302, and the peripheral device interface 1303 may be connected through buses or signal lines.
  • Each peripheral device can be connected to the peripheral device interface 1303 through a bus, a signal line or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 1304 , a display screen 1305 , a camera component 1306 , an audio circuit 1307 , a positioning component 1308 and a power supply 1309 .
  • the terminal 1300 further includes one or more sensors 1310 .
  • the one or more sensors 1310 include, but are not limited to: an acceleration sensor 1311 , a gyro sensor 1312 , a pressure sensor 1313 , a fingerprint sensor 1314 , an optical sensor 1315 and a proximity sensor 1316 .
  • FIG. 13 does not constitute a limitation to the terminal 1300, and may include more or less components than shown in the figure, or combine certain components, or adopt a different component arrangement.
  • FIG. 14 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • the server 1400 may have relatively large differences due to different configurations or performances, and may include one or more than one processor (Central Processing Units, CPU) 1401 and one Or more than one memory 1402, wherein 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 by the above method embodiments.
  • the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for realizing device functions, which will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor, so as to realize the image clustering in the above-mentioned embodiment The operation performed in the method.
  • the embodiment of the present application also provides a computer program product or computer program, the computer program product or computer program includes computer program code, the computer program code is stored in a computer-readable storage medium, and the processor of the computer device reads from the computer-readable storage medium The computer program code is read, and the processor executes the computer program code, so that the computer device implements the operations performed in the image clustering method of the above-mentioned embodiments.
  • the computer programs involved in the embodiments of the present application can be deployed and executed on one computer device, or executed on multiple computer devices at one location, or distributed in multiple locations and communicated Executed on multiple computer devices interconnected by the network, multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例公开了一种图像聚类方法、装置、计算机设备及存储介质。该方法包括:基于M个图像组,确定第一聚类参数;对于M个图像组中的任一目标图像组,将目标图像组划分成两个图像组得到M+1个参考图像组,将基于M+1个参考图像组确定的参考聚类参数确定为目标图像组的第二聚类参数,第二聚类参数表示M+1个参考图像组中的图像的聚类程度;在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;目标第二聚类参数为M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。本申请能够提高图像聚类的聚类程度。

Description

图像聚类方法、装置、计算机设备及存储介质
本申请要求于2021年08月09日提交中国专利局、申请号为2021109079733、申请名称为“图像聚类方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及人工智能技术领域,特别涉及图像聚类技术。
背景技术
随着计算机技术的不断发展,对于图像处理的需求越来越多。而图像聚类是一种常用的图像处理方式,图像聚类用于将多个图像划分至若干个不同的类别。相关技术中,通常预先确定目标数量的类别,然后采用聚类算法将多个图像划分到该目标数量的类别中。但是,目前采用聚类算法进行图像聚类所达到的聚类程度不够高。
发明内容
本申请实施例提供了一种图像聚类方法、装置、计算机设备及存储介质,能够提高图像聚类的聚类程度。所述技术方案如下:
一方面,提供了一种图像聚类方法,由计算机设备执行,所述方法包括:
基于M个图像组,确定第一聚类参数,所述第一聚类参数表示所述M个图像组中的图像的聚类程度,所述M为大于1的整数;
对于所述M个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+1个参考图像组,将基于所述M+1个参考图像组确定的参考聚类参数确定为所述目标图像组的第二聚类参数,所述第二聚类参数表示所述M+1个参考图像组中的图像的聚类程度;
在目标第二聚类参数表示的聚类程度不低于所述第一聚类参数表示的聚类程度的情况下,将所述目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;所述目标第二聚类参数为所述M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
另一方面,提供了一种图像聚类装置,所述装置包括:
第一参数确定模块,用于基于M个图像组,确定第一聚类参数,所述第一聚类参数表示所述M个图像组中的图像的聚类程度,所述M为大于1的整数;
第二参数确定模块,用于对于所述M个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+1个参考图像组,将基于所述M+1个参考图像组确定的参考聚类参数确定为所述目标图像组的第二聚类参数,所述第二聚类参数表示所述M+1个参考图像组中的图像的聚类程度;
图像组划分模块,用于在目标第二聚类参数表示的聚类程度不低于所述第一聚类参数表示的聚类程度的情况下,将所述目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;所述目标第二聚类参数为所述M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器加载并执行以实现如上述方面所述的图像聚类方法中所执行的操作。
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条计算机程序,所述至少一条计算机程序由处理器加载并执行以实现如上述方面所述的图像聚类方法中所执行的操作。
另一方面,提供了一种计算机程序产品或计算机程序,所述计算机程序产品或计算机程序包括计算机程序代码,所述计算机程序代码存储在计算机可读存储介质中,计算机设备的处理器从计算机可读存储介质读取所述计算机程序代码,处理器执行所述计算机程序代码,使得所述计算机设备实现如上述方面所述的图像聚类方法中所执行的操作。
本申请实施例提供的方法、装置、计算机设备及存储介质,分别确定将M个图像组中的每个图像组划分成两个新的图像组后的第二聚类参数,如果目标第二聚类参数(M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数)表示的聚类程度不低于划分前的第一聚类参数表示的聚类程度,则说明将该目标第二聚类参数对应的图像组划分成两个新的图像组,能够提高图像组中的图像的聚类程度,因此将该图像组划分成两个新的图像组,得到M+1个图像组,实现了对M个图像组继续进行细分,有利于进一步区分易混淆的图像,从而提高图像聚类的聚类程度。
附图说明
图1是本申请实施例提供的一种实施环境的示意图;
图2是本申请实施例提供的一种图像聚类方法的流程图;
图3是本申请实施例提供的一种图像分类模型的示意图;
图4是本申请实施例提供的另一种图像分类模型的示意图;
图5是本申请实施例提供的一种图像聚类方法的流程图;
图6是本申请实施例提供的一种第一特征提取网络的示意图;
图7是本申请实施例提供的一种确定聚类参数的流程图;
图8是本申请实施例提供的一种模型训练方法的流程图;
图9是本申请实施例提供的一种训练图像分类模型的示意图;
图10是本申请实施例提供的另一种图像聚类方法的流程图;
图11是本申请实施例提供的一种图像聚类装置的结构示意图;
图12是本申请实施例提供的另一种图像聚类装置的结构示意图;
图13是本申请实施例提供的一种终端的结构示意图;
图14是本申请实施例提供的一种服务器的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
本申请实施例提供的图像聚类方法涉及人工智能技术中的计算机视觉技术,以下对本申请实施例提供的图像聚类方法进行说明。
本申请实施例提供的图像聚类方法,能够由计算机设备执行。可选地,该计算机设备可以为终端或服务器。该服务器可以是独立的物理服务器,或者,是多个物理服务器构成的服务器集群或者分布式系统,或者,是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。该终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。
在一种可能实现方式中,本申请实施例涉及的计算机程序可被部署在一个计算机设备上执行,或者部署在位于一个地点的多个计算机设备上执行,又或者,部署在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链系统。
在一种可能实现方式中,本申请实施例中的计算机设备是区块链系统中的节点,该节点能够将聚类得到的多个图像组存储在区块链中,之后该节点或者该区块链中的其他节点可从区块链中获取该多个图像组。
图1是本申请实施例提供的一种实施环境的示意图。该实施环境包括终端101和服务器102。终端101和服务器102之间通过无线或有线网络连接。
在一种可能实现方式中,终端101将多个图像发送给服务器102,服务器102可以采用本申请实施例提供的方法,对所接收的多个图像进行图像聚类,得到多个图像组,然后服务器102将该多个图像组返回给终端101。
在另一种可能实现方式中,终端101上安装有服务器102提供服务的目标应用,终端101可以通过目标应用实现例如图像处理或者图像传输等功能。例如,目标应用为图像处理应用,该图像处理应用能够对多个图像进行图像聚类。服务器101用于训练图像分类模型,并将训练好的图像分类模型部署于目标应用中,终端101运行目标应用时,可以调用图像分类模型对多个图像进行分类处理,得到多个图像组,然后采用本申请实施例提供的方法,继续对该多个图像组进行聚类,得到聚类程度更高的多个图像组。
图2是本申请实施例提供的一种图像聚类方法的流程图。本申请实施例的执行主体为计算机设备,可选地,该计算机设备可以为上述图1对应的实施例中的终端或者服务器。参见图2,该方法包括:
201、计算机设备基于M个图像组,确定第一聚类参数。
计算机设备获取M个图像组,M为大于1的整数,每个图像组包括至少一个图像。其中,属于同一个图像组的图像之间的相似度较高,属于不同图像组的图像之间的相似度较低,每个图像组可以看作一个聚类簇。
计算机设备基于该M个图像组,确定第一聚类参数,该第一聚类参数表示M个图像组中的图像的聚类程度。通常情况下,第一聚类参数越大,则图像之间的聚类程度越高,第一聚类参数越小,则图像之间的聚类程度越低。聚类程度反映同一图像组中的图像之间的凝聚程度,以及不同图像组中的图像之间的分离程度。其中,同一图像组中的图像之间的凝聚程度越高,且不同图像组中的图像之间的分离程度越高,则该M个图像组中的图像之间的聚类程度就越高。
202、对于M个图像组中的任一目标图像组,计算机设备将目标图像组划分成两个图像组,得到M+1个参考图像组,将基于M+1个参考图像组确定的参考聚类参数确定为目标图像组的第二聚类参数。
M个图像组中的每个图像组均可作为目标图像组,对于M个图像组中的任一目标图像组,计算机设备将目标图像组划分成两个图像组,将这两个图像组与M个图像组中除了该目标图像组之外的M-1个图像组,均作为参考图像组,则能够得到M+1个参考图像组。计算机设备基于该M+1个参考图像组,确定参考聚类参数,将该参考聚类参数确定为该目标图像组的第二聚类参数,该第二聚类参数表示该M+1个参考图像组中的图像的聚类程度。
计算机设备对M个图像组中的每一个图像组均执行该步骤202中的操作,则能够得到M个图像组中每一个图像组的第二聚类参数,也即是得到M个第二聚类参数。
203、计算机设备在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;该目标第二聚类参数为M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
由于第二聚类参数表示M+1个参考图像组中的图像的聚类程度,因此,计算机设备可以在获取到的M个图像组的第二聚类参数中确定所表示的聚类程度最高的第二聚类参数,作为目标第二聚类参数,相应地,将该目标第二聚类参数对应的目标图像组划分成两个图像组之后,得到的M+1个参考图像组的图像的聚类程度也是最高的,也即是,如果需要将M个图像组中的某一个图像组划分成两个图像组,将目标第二聚类参数对应的目标图像组划分成 两个图像组能够使图像的聚类程度最高,该划分方式是最好的划分方式。
应理解,在聚类参数越大,所表示的聚类程度越高的情况下,上述目标第二聚类参数应为M个图像组各自的第二聚类参数中最大的第二聚类参数;在聚类参数越小,所表示的聚类程度越高的情况下,上述目标第二聚类参数应为M个图像组各自的第二聚类参数中最小的第二聚类参数。
计算机设备将目标第二聚类参数表示的聚类程度与第一聚类参数表示的聚类程度进行比较,在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组之后,图像的聚类程度不低于原始的M个图像组的图像的聚类程度,因此计算机设备将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组。在另一实施例中,在目标第二聚类参数表示的聚类程度低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组之后,图像的聚类程度低于原始的M个图像组的图像的聚类程度,则计算机设备不再对M个图像组中的图像组进行划分。
本申请实施例提供的方法,分别确定将M个图像组中的每个图像组划分成两个新的图像组后的第二聚类参数,如果目标第二聚类参数表示的聚类程度不小于划分前的第一聚类参数表示的聚类程度,则说明将该目标第二聚类参数对应的图像组划分成两个新的图像组,能够提高图像组中的图像的聚类程度,因此将该图像组划分成两个新的图像组,得到M+1个图像组,实现了对M个图像组继续进行细分,有利于进一步区分易混淆的图像,从而提高图像聚类的聚类程度。
在一些实施例中,M个图像组是根据图像分类模型对多个图像的分类结果划分出来的,图像分类模型用于对图像进行分类处理,得到图像的类别标签。图3是本申请实施例提供的一种图像分类模型的示意图,如图3所示,图像分类模型30包括第一特征提取网络301和图像分类网络302,第一特征提取网络301与图像分类网络302连接,第一特征提取网络301用于对图像进行特征提取,图像分类网络302用于基于图像特征进行分类处理。
在一种可能实现方式中,如图4所示,图像分类模型30还包括第二特征提取网络303,第二特征提取网络303与第一特征提取网络301连接,第二特征提取网络303用于对第一特征提取网络301提取出的图像特征继续进行特征提取。
图5是本申请实施例提供的一种图像聚类方法的流程图。本申请实施例的执行主体为计算机设备,可选地,该计算机设备可以为上述图1对应的实施例中的终端或者服务器。参见图5,该方法包括:
501、计算机设备获取对目标对象进行拍摄得到的多个图像。
计算机设备获取多个图像,该多个图像均是对同一目标对象进行拍摄得 到的。例如,目标对象为人体,该多个图像可以是对同一人体的不同器官进行拍摄得到的;或者,目标对象为器官,该多个图像可以是对同一器官的不同部位进行拍摄得到的;或者目标对象为场景,该多个图像可以是对同一场景在不同时间点进行拍摄得到的。可选地,在医疗领域中,该多个图像可以为数字病理全景图像(Whole Slide Images,WSIs),数字病理全景图像是通过数字病理扫描仪对病理显微切片进行扫描得到的图像,数字病理扫描仪由光学系统、线性扫描相机等部件组成。
502、计算机设备调用图像分类模型,分别对多个图像进行分类处理,得到每个图像的类别标签。
计算机设备中存储有图像分类模型,该图像分类模型用于对图像进行分类处理,可选地,该图像分类模型可以是卷积神经网络模型(Convolutional Neural Network,CNN),该图像分类模型的网络结构详见上述图3的实施例,该图像分类模型的训练过程详见下述图8的实施例,在此暂不做说明。计算机设备获取到多个图像后,调用该图像分类模型,分别对多个图像中的每个图像进行分类处理,得到每个图像的类别标签,图像的类别标签能够表示图像所属的类别。
在一种可能实现方式中,如图3所示,图像分类模型包括第一特征提取网络和图像分类网络,第一特征提取网络和图像分类网络连接。计算机设备对于多个图像中的每个图像,调用第一特征提取网络,对图像进行特征提取,得到第一图像特征,调用图像分类网络,基于第一图像特征进行分类处理,得到图像的类别标签。
其中,第一特征提取网络的输入为图像,图像分类网络的输入为第一特征提取网络的输出。可选地,图像分类网络是由两个全连接层组成的神经网络。第一特征提取网络输出的第一图像特征用于表示图像的特征,例如第一图像特征为多维的特征向量矩阵,或者第一图像特征为用于表示特征的图像等。
在另一种可能实现方式中,图像为病理切片图像,第一特征提取网络包括K个特征提取层和特征转换层,特征提取层用于提取图像特征,特征转换层用于对图像特征进行转换。计算机设备调用K个特征提取层,对图像依次进行特征提取,得到每个特征提取层输出的图像特征,调用特征转换层,对最后L个特征提取层输出的图像特征进行特征转换,得到第一图像特征,L为大于1且不大于K的整数。该第一特征提取网络中,K个特征提取层依次连接,特征转换层分别与最后L个特征提取层连接。
具体的,按照从前往后的排列顺序,K个特征提取层依次提取从浅层到深层的图像特征,考虑到病理切片图像的分类更依赖于图像中细胞核的形态信息以及分布情况的纹理信息,而这些信息需要从浅层网络提取的图像特征中获取,因此在进行特征转换时,不是只对最后一个特征提取层输出的图像 特征进行特征转换,而是对最后L个特征提取层输出的图像特征进行特征转换,使得最后得到的第一图像特征不仅包括最后一个特征提取层输出的深层的图像特征,还包括最后一个特征提取层之前的特征提取层输出的相对浅层的图像特征,从而提高第一特征提取网络对病理切片图像的特征提取能力。
可选地,第一特征提取网络中的特征提取层为卷积层,特征转换层为全连接层,在最后L个特征提取层与特征转换层之间还连接有池化层,池化层用于对特征提取层提取出来的图像特征进行池化处理。如图6所示,第一特征提取网络包括卷积层601-卷积层604和全连接层605,最后3个卷积层(即卷积层602-卷积层604)与全连接层605之间还分别连接有池化层,计算机设备将病理切片图像输入至第一特征提取网络的卷积层601中,卷积层601输出的图像特征输入至卷积层602中,卷积层602输出的图像特征分别输入至卷积层603和池化层612,卷积层603输出的图像特征分别输入至卷积层604和池化层613,卷积层604输出的图像特征输入至池化层614。其中,池化层612、池化层613和池化层614各自输出的图像特征均输入至全连接层605,全连接层605对三个池化层输出的图像特征进行特征转换,得到第一图像特征。
可选地,第一特征提取网络中的卷积层可以由残差神经网络、GoogleNet(一种神经网络)或者VGGnet(Visual Geometry Group Network,视觉几何群网络)等网络结构组成。
503、计算机设备基于每个图像的类别标签,将相同类别的图像划分到同一个图像组中,得到M个图像组。
计算机设备获取到每个图像的类别标签后,能够基于每个图像的类别标签,确定每个图像所属的类别。计算机设备将相同类别的图像划分到同一个图像组中,得到M个图像组,M为大于1的整数。每个图像组包括至少一个图像,属于同一个图像组的图像属于相同类别,这些图像之间的相似度较高,属于不同图像组的图像属于不同类别,这些图像之间的相似度较低。在上述步骤501-503中,相当于将获取到的多个图像进行图像聚类,得到多个图像组,每个图像组可以为一个聚类簇。
可选地,图像的类别标签包括图像属于每个类别的概率,对于每个图像,将该图像的类别标签中最大概率对应的类别,确定为该图像所属的类别。
需要说明的是,在上述步骤501-503中,计算机设备通过图像分类模型先确定每个图像的所属的类别,然后再根据每个图像所属的类别,将多个图像划分成M个图像组,但是由于图像分类模型所能确定的类别个数是固定的,例如图像分类模型输出的类别标签中包括K个类别的概率,则M一定不大于K,相当于限制了将多个图像进行聚类得到的多个图像组的数量,因此会存在同一图像组内的图像之间的凝聚程度不够高的情况,导致M个图像组中的图像的聚类程度不够高。因此,计算机设备需要继续执行下述步骤504-508, 来对M个图像组进行进一步的划分。
504、计算机设备基于M个图像组,确定第一聚类参数。
计算机设备基于该M个图像组,确定第一聚类参数,该第一聚类参数表示M个图像组中的图像的聚类程度。通常情况下,第一聚类参数越大,则图像之间的聚类程度越高,第一聚类参数越小,则图像之间的聚类程度越低。聚类程度反映同一图像组中的图像之间的凝聚程度,以及不同图像组中的图像之间的分离程度。其中,同一图像组中的图像之间的凝聚程度越高,且不同图像组中的图像之间的分离程度越高,则该M个图像组中的图像之间的聚类程度就越高。
在一种可能实现方式中,计算机设备基于每个M个图像组中的图像的第一图像特征,确定第一聚类参数,如图7所示,包括以下步骤:
701、对于M个图像组中的每个图像,计算机设备基于该图像的第一图像特征、该图像所属的图像组中的其他图像的第一图像特征、以及其他图像组中的图像的第一图像特征,确定该图像对应的凝聚参数和分离参数。其中,凝聚参数表示图像与图像所属的图像组中的其他图像之间的不相似程度,分离参数表示图像与其他图像组中的图像之间的不相似程度。
计算机设备基于该图像的第一图像特征、以及该图像所属的图像组中的其他图像的第一图像特征,确定该图像对应的凝聚参数。计算机设备基于该图像的第一图像特征、以及除了该图像所属的图像组之外的其他图像组中的图像的第一图像特征,确定该图像对应的分离参数。
示例性的,对于每个其他图像组,计算机设备可以基于该图像的第一图像特征、以及该其他图像中的图像的第一图像特征,确定该图像与该其他图像组之间的候选分离参数。从而确定出该图像与各个其他图像组之间的最小的候选分离参数,将最小的候选分离参数确定为该图像对应的分离参数。
示例性的,计算机设备可以基于该图像的第一图像特征以及图像所属的图像组中的其他图像的第一图像特征,确定该图像与每个其他图像之间的距离,然后将该图像与各个其他图像之间的距离的均值,确定为该图像对应的凝聚参数。该图像与其他图像之间的距离越小,该图像与同一图像组中的其他图像之间的相似度越高,该图像对应的凝聚参数越小。因此图像对应的凝聚参数越小,图像与图像所属的图像组中的其他图像之间的不相似程度越低,则图像组的聚类程度越高。
示例性的,对于每个其他图像组,计算机设备可以基于该图像的第一图像特征以及该其他图像组中的每个图像的第一图像特征,确定该图像与该其他图像组中的每个图像之间的距离,然后将该图像与其他图像组中的多个图像之间的距离的均值,确定为该图像与该其他图像组之间的候选分离参数;进而,在该图像与各个其他图像组之间的候选分离参数中,确定最小的候选分离参数,作为该图像对应的分离参数。该图像与其他图像组中的图像之间 的距离越大,该图像与其他图像组中的图像之间的相似度越低,该图像对应的分离参数越大。因此图像对应的分离参数越大,图像与其他图像组中的图像之间的不相似程度越高,则图像组的聚类程度越高。其中,图像之间的距离可以为余弦距离或者欧氏距离等,本申请实施例对此不做限定。
702、计算机设备基于凝聚参数和分离参数,确定该图像对应的聚类子参数。其中,聚类子参数与凝聚参数负相关,聚类子参数与分离参数正相关。
凝聚参数越大,图像对应的聚类子参数越小,凝聚参数越小,图像对应的聚类子参数越大;分离参数越大,图像对应的聚类子参数越大,分离参数越小,图像对应的聚类子参数越小。图像对应的聚类子参数越大,该图像的聚类程度越高。
可选地,计算机设备采用以下公式,确定图像对应的聚类子参数:
Figure PCTCN2022099660-appb-000001
其中,i表示图像,SC(i)表示该图像对应的聚类子参数,a(i)表示该图像对应的凝聚参数,b(i)表示该图像对应的分离参数。
703、计算机设备基于所述M个图像组中各个图像各自对应的聚类子参数,确定第一聚类参数。
计算机设备确定每个图像对应的聚类子参数,基于各个图像各自对应的聚类子参数,确定第一聚类参数。可选地,计算机设备将各个图像各自对应的聚类子参数的均值,确定为第一聚类参数。
可选地,第一聚类参数越接近1,表示同一图像组中的多个图像之间的间距越小,不同图像组中的多个图像之间的间距越大,则M个图像组中的图像的聚类程度越高。第一聚类参数越接近-1,表示同一图像组中的多个图像之间的间距越大,不同图像组中的多个图像之间的间距越小,则M个图像组中的图像的聚类程度越小。
505、对于M个图像组中的任一目标图像组,计算机设备将目标图像组划分成两个图像组,得到M+1个参考图像组,将基于M+1个参考图像组确定的参考聚类参数确定为目标图像组的第二聚类参数。
M个图像组中的每个图像组均可作为目标图像组,对于M个图像组中的任一目标图像组,计算机设备将目标图像组划分成两个图像组,将基于M+1个参考图像组确定的参考聚类参数确定为该目标图像组的第二聚类参数,该第二聚类参数表示M+1个参考图像组中的图像的聚类程度。其中,计算机设备对M个图像组中的每一个图像组均执行该步骤202中的操作,则能够得到M个图像组中每一个图像组的第二聚类参数,也即得到M个第二聚类参数。
例如,M为3,M个图像组包括图像组1、图像组2和图像组3。计算机设备将图像组1划分成图像组11和图像组12,基于图像组11、图像组12、 图像组2和图像组3,确定第二聚类参数a。计算机设备将图像组2划分成图像组21和图像组22,基于图像组1、图像组21、图像组22和图像组3,确定第二聚类参数b。计算机设备将图像组3划分成图像组31和图像组32,基于图像组1、图像组2、图像组31和图像组32,确定第二聚类参数c,从而得到3个第二聚类参数,即图像组1的第二聚类参数a、图像组2的第二聚类参数b和图像组3的第二聚类参数c。
可选地,计算机设备采用谱聚类算法、k-means算法(一种无监督的聚类算法)或者基于GMM(Gaussian Mixed Model,高斯混合模型)的最大期望聚类算法等任一聚类算法,将目标图像组划分成两个新的图像组。
506、计算机设备在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;目标第二聚类参数为M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
由于第二聚类参数表示M+1个参考图像组中的图像的聚类程度,因此,计算机设备可以在获取到的M个图像组的第二聚类参数中确定所表示的聚类程度最高的目标第二聚类参数,将该目标第二聚类参数对应的目标图像组划分成两个图像组之后,得到的M+1个参考图像组的图像的聚类程度最高。计算机设备将目标第二聚类参数表示的聚类程度与第一聚类参数表示的聚类程度进行比较,在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组之后,图像的聚类程度不低于原始的M个图像组的图像的聚类程度,因此计算机设备将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组。
在另一实施例中,在目标第二聚类参数表示的聚类程度低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组之后,图像的聚类程度低于原始的M个图像组的图像的聚类程度,则计算机设备不再对M个图像组中的图像组进行划分,且无需执行下述步骤507-508。
507、对于M+1个图像组中的任一目标图像组,计算机设备继续将目标图像组划分成两个图像组,得到M+2个参考图像组,将基于M+2个参考图像组确定的参考聚类参数确定为目标图像组的第三聚类参数。
计算机设备得到M+1个图像组之后,对于该M+1个图像组中的任一目标图像组,继续将目标图像组划分成两个图像组以得到M+2个参考图像组,将基于M+2个参考图像组确定的参考聚类参数确定为目标图像组的第三聚类参数,该第三聚类参数表示M+2个参考图像组的聚类程度。其中,计算机设备对M+1个图像组中的每个图像组均执行该步骤507中的操作,则能够得到M+1个图像组中每个图像组的第三聚类参数,也即得到M+1个第三聚类参数。
该步骤507中确定第三聚类参数的过程,与上述步骤505中确定第二聚类参数的过程同理,在此不再一一赘述。
508、计算机设备在目标第三聚类参数表示的聚类程度不低于目标第二聚类参数表示的聚类程度的情况下,将目标第三聚类参数对应的目标图像组划分成两个图像组,得到M+2个图像组,直至本轮划分后得到的多个聚类参数中最大的聚类参数小于划分前的聚类参数。
计算机设备在步骤508中得到M+2个图像组的过程,与上述步骤506中得到M+1个图像组的过程同理,在此不再一一赘述。
其中,计算机设备得到M+2个图像组之后,继续对M+2个图像组中的任一目标图像组进行划分,并重新确定聚类参数,然后根据聚类参数的大小来确定是否将M+2个图像组继续划分为M+3个图像组。也即是,计算机设备执行多次迭代过程,上述步骤505-506以及步骤507-508均为一次迭代过程。在本轮迭代过程中,如果本轮划分后得到的多个聚类参数中,目标聚类参数(即本轮划分后得到的、所表示的聚类程度最高的聚类参数)表示的聚类程度低于划分前的目标聚类参数(即上一轮划分后得到的、所表示的聚类程度最高的聚类参数)表示的聚类程度,则说明对当前的任意一个图像组进行划分后的聚类程度,都低于划分前的聚类程度,因此计算机设备停止迭代过程,完成对M个图像组的进一步划分。
例如,初始的M个图像组为C={c i},c i∈[0,1,…,M-1],在每轮迭代过程中,将划分前的多个图像组定义为C prev,将划分后的多个图像组定义为C cur,将划分后的多个图像组的数量定义为K,将C prev对应的聚类参数定义为SC prev,将C cur对应的聚类参数定义为SC cur。将参数初始化为:C prev=C cur=C,K=M,执行如下的迭代过程,直至满足迭代终止条件则停止迭代:
(1)对当前的M个图像组,分别确定将每个图像组划分成两个图像组后得到的
Figure PCTCN2022099660-appb-000002
在M个
Figure PCTCN2022099660-appb-000003
中确定最大值,将最大值记为
Figure PCTCN2022099660-appb-000004
将图像组
Figure PCTCN2022099660-appb-000005
划分成两个图像组,将得到的M+1个图像组记为新的C cur={c i},c i∈[0,1,…,M]。
(2)如果
Figure PCTCN2022099660-appb-000006
说明将图像组
Figure PCTCN2022099660-appb-000007
划分成两个图像组,能够提高图像的聚类程度。则计算机设备将图像组
Figure PCTCN2022099660-appb-000008
划分成两个图像组,更新C prev=C cur,K=M+1,进行下一轮迭代过程。如果
Figure PCTCN2022099660-appb-000009
则退出迭代过程,将最终获得的C cur={c i},c i∈[0,1,…,M]作为图像聚类的结果。
在本申请实施例中包括两个过程,一个是基于图像分类模型进行图像聚类,对于没有类别标签的多个图像,使用端到端的图像分类模型进行处理,得到每个图像的类别标签,从而实现初步的图像聚类;另一个是基于聚类参数进行图像聚类,以聚类参数为依据,将当前的多个图像组进行进一步的划分,区分出分布更紧致的图像组,直至划分后的聚类参数表示的聚类程度均低于划分前的聚类参数表示的聚类程度,则终止对图像组继续进行划分,得 到最终的聚类结果。
本申请实施例提供的方法,分别确定将M个图像组中的每个图像组划分成两个新的图像组后的第二聚类参数,如果目标第二聚类参数(所表示的聚类程度最高的第二聚类参数)表示的聚类程度不低于划分前的第一聚类参数表示的聚类程度,则说明将该目标第二聚类参数对应的图像组划分成两个新的图像组,能够提高图像组中的图像的聚类程度,因此将该图像组划分成两个新的图像组,得到M+1个图像组,实现了对M个图像组继续进行细分,有利于进一步区分易混淆的图像,从而提高图像聚类的聚类程度。
并且,先调用图像分类模型确定多个图像的类别标签,基于类别标签将多个图像划分为M个图像组,实现对多个图像进行初步的图像聚类,然后基于聚类参数将M个图像组继续进行细分,实现对多个图像进行更精准的图像聚类,采用两种方式相结合的方法,既能够提高图像聚类的效率,又能够提高图像聚类的聚类程度。
并且,对最后L个特征提取层输出的图像特征进行特征转换,使得最后得到的第一图像特征不仅包括最后一个特征提取层输出的深层的图像特征,还包括最后一个特征提取层之前的特征提取层输出的相对浅层的图像特征,能够提高第一特征提取网络对病理切片图像的特征提取能力。
图8是本申请实施例提供的一种模型训练方法的流程图,本申请实施例所训练的图像分类模型,可应用于上述图5所示的实施例中。其中,该方法的执行主体为计算机设备,可选地,该计算机设备可以为上述图1对应的实施例中的终端或者服务器。参见图8,该方法包括以下步骤:
801、计算机设备获取样本图像。
样本图像可以为任意类型的图像,可以为采用任意方式获取的样本图像。例如,计算机设备获取不同人体的不同器官的多个病理切片图像,将每个病理切片图像切分成尺寸相同的多个图像块,将切换得到的多个图像块作为样本图像。
其中,本申请实施例中的样本图像是没有真实的类别标签的图像,本申请实施例的训练方法是基于无标签的样本图像进行无监督学习的训练方法。
802、计算机设备对样本图像分别采用不同的方式进行扰动处理,得到多个扰动图像。
计算机设备采用扰动处理的方式,增强样本图像的随机性。计算机设备分别采用不同的方式对样本图像进行扰动处理,得到多个不同的扰动图像。
其中,不同的扰动处理方式可以包括不同的扰动类型,扰动类型包括颜色抖动、高斯模糊、旋转、裁剪部分区域后放大至原尺寸等。每次扰动处理可以仅包括一种扰动类型,也可以包括多种扰动类型。可选地,每次对样本图像进行扰动处理时,对多个扰动类型进行遍历,对于当前遍历的扰动类型, 计算机设备按照该扰动类型的发生概率来确定本次是否选取该扰动类型,如果是,则按照该扰动类型进行扰动处理,并继续遍历下一个扰动类型,如果不是,则无需按照该扰动类型进行扰动处理,直接遍历下一个扰动类型,直至遍历最后一个扰动类型,从而采用多种扰动类型结合的方式对样本图像执行一次扰动处理,得到一个扰动图像。然后计算机设备按照上述步骤,继续对样本图像执行另一次扰动处理,得到另一个扰动图像。可选地,每种扰动类型的发生概率可以设置为0.5,以便增强扰动图像的随机性。
以对2个样本图像分别进行2次扰动处理为例,计算机设备按照每种扰动方式的发生概率,选取多种扰动类型,按照本次选取的多种扰动类型,分别对2个样本图像进行扰动处理,得到2个扰动图像。然后计算机设备再次按照每种扰动方式的发生概率,选取多种扰动类型,按照本次选取的多种扰动类型,分别对2个样本图像进行扰动处理,再次得到2个扰动图像。则计算机设备最终得到4个扰动图像。
803、计算机设备调用待训练的图像分类模型,分别对每个扰动图像进行分类处理,得到每个扰动图像的类别标签。
在一种可能实现方式中,图像分类模型包括第一特征提取网络和图像分类网络。计算机设备对于每个扰动图像,调用第一特征提取网络,对扰动图像进行特征提取,得到第二图像特征,调用图像分类网络,基于第二图像特征进行分类处理,得到扰动图像的类别标签。其中,该类别标签是图像分类模型所预测出来的伪标签,而不是扰动图像的真实的类别标签。
在另一种可能实现方式中,如图4所示,图像分类模型还包括第二特征提取网络。计算机设备得到第二图像特征后,还会调用第二特征提取网络,对第二图像特征进行特征提取,得到第三图像特征。
其中,第二特征提取网络与第一特征提取网络连接,该第一特征提取网络与第二特征提取网络均用于提取图像特征,不同之处在于,第一特征提取网络提取的是图像的特征,第二特征提取网络提取的是图像特征的特征,相比于第一特征提取网络提取出来的第一图像特征,第二特征提取网络提取出来的第二图像特征是更深层次的特征。本申请实施例中的第三图像特征可用于训练图像分类模型,利用第三图像特征训练图像分类模型的过程详见下述步骤804,在此暂不做说明。
其中,该步骤803中获取第二图像特征和扰动图像的类别标签的过程,与上述步骤502中获取第一图像特征和图像的类别标签的过程同理,在此不再一一赘述。
804、计算机设备基于每个扰动图像的类别标签,训练图像分类模型。
计算机设备得到每个扰动图像的类别标签后,基于每个扰动图像的类别标签,训练图像分类模型,以提高图像分类模型的分类能力。训练完成的图像分类模型,对于给定的任一图像,可以对该图像进行分类处理,得到该图 像的类别标签。可选地,类别标签包括该图像属于每个类别的概率,类别标签中最大概率对应的类别,即为该图像所属的类别。
在一种可能实现方式中,样本图像的数量为多个,扰动图像的类别标签包括扰动图像属于每个类别的概率。计算机设备获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第一差异参数,获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第二差异参数,基于第一差异参数与第二差异参数,训练图像分类模型,以使调用训练后的图像分类模型得到的第一差异参数减小,且第二差异参数增大。
对于对同一样本图像进行扰动处理得到的多个扰动图像来说,由于该多个扰动图像来源于同一个样本图像,因此该多个扰动图像所属的类别与该样本图像所属的类别应当是相同的,即该多个图像所属的类别也是相同的。扰动图像的类别标签是图像分类模型预测的,如果图像分类模型的准确率足够高,则对于每一个类别,该多个扰动图像属于该类别的概率应该足够接近。因此,计算机设备确定该多个扰动图像属于同一类别的概率之间的第一差异参数,该第一差异参数越小,则多个扰动图像属于同一类别的概率越接近,则图像分类模型越准确,因此计算机设备基于该第一差异参数,训练图像分类模型,以使第一差异参数减小,从而提高图像分类模型的分类能力。
对于对不同样本图像进行扰动处理得到的多个扰动图像来说,由于该多个扰动图像来源于不同的样本图像,因此该多个扰动图像所属的类别分别与不同的样本图像所属的类别是相同的,即该多个图像所属的类别是不同的。扰动图像的类别标签是图像分类模型预测的,如果图像分类模型的准确率足够高,则对于每一个类别,该多个扰动图像属于该类别的概率的差异应该足够大。因此,计算机设备确定该多个扰动图像属于同一类别的概率之间的第二差异参数,该第二差异参数越大,该多个扰动图像属于同一类别的概率之间的差异越大,则图像分类模型越准确,因此计算机设备基于该第二差异参数,训练图像分类模型,以使第二差异参数增大,从而提高图像分类模型的分类能力。
在另一种可能实现方式中,图像分类模型还包括第二特征提取网络,在上述步骤803中,计算机设备获取到第二图像特征后,还调用第二特征提取网络,对第二图像特征进行特征提取,得到第三图像特征。则计算机设备还可以基于每个扰动图像的第三图像特征,训练图像分类模型。
可选地,样本图像的数量为多个,则基于每个扰动图像的第三图像特征,训练图像分类模型的过程,包括:计算机设备获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第三差异参数,获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第四差异参数,基于第三 差异参数与第四差异参数,训练图像分类模型,以使调用训练后的图像分类模型得到的第三差异参数减小,且第四差异参数增大。
对于对同一样本图像进行扰动处理得到的多个扰动图像来说,由于该多个扰动图像来源于同一个样本图像,因此该多个扰动图像的图像特征与该样本图像的图像特征是相似的,即该多个图像的图像特征也是相似的。如果图像分类模型的准确率足够高,则图像分类模所提取出来的每个扰动图像的图像特征应该足够接近。因此,计算机设备确定该多个扰动图像的第三图像特征之间的第三差异参数,该第三差异参数越小,则多个扰动图像的第三图像特征越接近,则图像分类模型越准确,因此计算机设备基于该第三差异参数,训练图像分类模型,以使第三差异参数减小,从而提高图像分类模型的分类能力。
对于对不同样本图像进行扰动处理得到的多个扰动图像来说,由于该多个扰动图像来源于不同的样本图像,因此该多个扰动图像的图像特征分别与不同的样本图像的图像特征是相似的,即该多个图像的图像特征是不相似的。如果图像分类模型的准确率足够高,则图像分类模型提取出来的每个扰动图像的图像特征的差异应该足够大。因此,计算机设备确定该多个扰动图像的第三图像特征之间的第四差异参数,该第四差异参数越大,该多个扰动图像的第三图像特征之间的差异越大,则图像分类模型越准确,因此计算机设备基于该第四差异参数,训练图像分类模型,以使第四差异参数增大,从而提高图像分类模型的分类能力。
可选地,计算机设备基于第一差异参数和第二差异参数确定第一损失值,基于第三差异参数和第四差异参数确定第二损失值,对第一损失值和第二损失值进行加权求和得到目标损失值。计算机设备基于目标损失值,训练图像分类模型,以使调用训练后的图像分类模型得到的目标损失值减小。
其中,第一损失值与第一差异参数正相关,第一损失值与第二差异参数负相关,也即是第一差异参数越大,该第一损失值越大,第一差异参数越小,该第一损失值越小,第二差异参数越大,该第一损失值越小,第二差异参数越小,该第一损失值越大。第二损失值与第三差异参数正相关,第三损失值与第四差异参数负相关,也即是第三差异参数越大,该第二损失值越大,第三差异参数越小,该第二损失值越小,第四差异参数越大,该第二损失值越小,第四差异参数越小,该第二损失值越大。可选地,第一损失值和第二损失值各自对应的权重系数均为0.5。
本申请实施例中,通过基于来源于同一样本图像的扰动图像进行对比学习,以及基于来源于不同样本图像的扰动图像进行对比学习,来提高图像分类模型的特征提取能力以及对不同类别的图像的分辨能力。采用对比学习的方式,实现了对图像分类模型进行无监督训练,无需人工对样本图像进行标注,有利于节约人力和时间,且能够避免人工标注所导致的错误标签,因此 提高了图像分类模型的训练效率以及准确率。
在一种可能实现方式中,由于本申请实施例训练图像分类模型的过程为无监督训练,训练过程中没有真实的样本类别标签,图像分类模型仅能够确定图像属于每个类别的概率,但是无法确定每个类别的真实含义。可选地,计算机设备无需确定每个类别的真实含义,后续只需利用图像分类模型将多个图像划分成不同的类别即可。可选地,计算机设备利用图像分类模型将多个图像划分成不同的类别后,基于划分结果,人工确定每个类别的真实含义。例如,在医疗领域中,图像分类模型能够将病理切片图像划分成7个类别,每个类别代表一种生理组织类型,进而由医生根据划分结果来确定每个类别所代表的生理组织类型。
需要说明的是,上述步骤801-804仅以一次迭代过程为例进行说明,在训练图像处理模型的过程中,需要进行多次迭代训练。在一种可能实现方式中,计算机设备响应于迭代轮次达到第一阈值,停止对该图像分类模型进行训练;或者,响应于当前迭代轮次得到的损失值不大于第二阈值,停止对图像分类模型进行训练。其中,第一阈值和第二阈值均可以根据实际需求设定,例如,第一阈值为10或15等,第二阈值为0.01或0.02等。
本申请实施例中,训练图像分类模型包括以下内容:
(1)所需准备的数据:无标签的样本图像集、模型训练的迭代总轮次E、每次迭代处理的样本图像的个数N、随机性增强策略、损失值的权重系数τ I和τ C、类别的数量M以及图像分类模型,图像分类模型包括第一特征提取网络f ω、第二特征提取网络
Figure PCTCN2022099660-appb-000010
和图像分类网络
Figure PCTCN2022099660-appb-000011
其中ω,
Figure PCTCN2022099660-appb-000012
分别为网络参数。迭代总轮次E和样本图像的个数N均为整数,例如E大于100,N大于128。
(2)网络结构:第一特征提取网络f ω是一个神经网络,输入为224*224*3维的样本图像,输出为512*1维的图像特征。第二特征提取网络
Figure PCTCN2022099660-appb-000013
和图像分类网络
Figure PCTCN2022099660-appb-000014
则将第一特征提取网络f ω输出的图像特征进一步投影到不同的空间,以分别进行特征的对比学习优化和类别的对比学习优化。其中,第二特征提取网络
Figure PCTCN2022099660-appb-000015
输入为512*1维的图像特征,输出为128*1维的图像特征,图像分类网络
Figure PCTCN2022099660-appb-000016
输入为512*1维的图像特征,输出为M*1维的类别标签。第二特征提取网络
Figure PCTCN2022099660-appb-000017
是由两层全连接层组成的神经网络,输入为512*1维,中间层为512*1维,输出为128*1维。图像分类网络
Figure PCTCN2022099660-appb-000018
是由两层全连接层组成的神经网络,输入为512*1维,中间层为512*1维,输出为M*1维。
(3)训练过程:图9是本申请实施例提供的一种训练图像分类模型的示意图,如图9所示,在一次迭代训练的过程中,从样本图像集中获取样本图像a和样本图像b,分别采用不同的方式对样本图像a和样本图像b进行扰动处理后,得到扰动图像a’、扰动图像b’、扰动图像a”和扰动图像b”。调用第一特征提取网络901,分别对每个扰动图像进行特征提取,得到每个扰动图 像的512维的图像特征,调用第二特征提取网络902对512维的图像特征进行特征提取,得到128维的图像特征,调用图像分类网络903对512维的图像特征进行分类处理,得到M维的类别标签。计算机设备基于第二特征提取网络902输出的图像特征进行特征维度的对比学习优化,基于图像分类网络903输出的类别标签进行类别维度的对比学习优化。
本申请实施例提供的方法,通过基于来源于同一样本图像的扰动图像进行对比学习,以及基于来源于不同样本图像的扰动图像进行对比学习,来提高图像分类模型的特征提取能力以及对不同类别的图像的分辨能力。采用对比学习的方式,实现了对图像分类模型进行无监督训练,无需人工对样本图像进行标注,有利于节约人力和时间,且能够避免人工标注所导致的错误标签,因此提高了图像分类模型的训练效率以及准确率。
上述实施例可应用于需要进行图像聚类的任意场景中,来对任意类型的图像进行图像聚类。例如,在医疗领域中,按照生理组织的类型对患者的多个病理切片图像进行图像聚类。图10是本申请实施例提供的一种图像聚类方法的流程图,参见图10,该方法包括:
1001、通过数字病理扫描仪将患者的病理显微切片扫描成数字图像,得到病理切片图像。
1002、将病理切片图像切分成多个病理切片图像块,构建无标签的数据集。
1003、调用图像分类模型,对每个病理切片图像块进行分类处理,得到每个图像块的图像特征和类别标签,基于类别标签将多个病理切片图像块划分至M个图像组。
1004、得到M个图像组后,基于聚类参数,继续对M个图像组进行细分,最终划分成N个图像组。
本申请实施例能够对无标签的病理切片图像块进行图像聚类,将多个病理切片图像块划分至多个图像组,每个图像组代表一种生理组织,从而为后续的病理分析任务提供支撑。例如,病理分析任务包括:通过生理组织的数量占比进行异常预测或者预后处理;通过将某一组织图像组与正常组织的图像组进行对比来判断该组织是否异常等,每个图像组对应一种生理组织。
除了按照生理组织的类型对病理切片图像进行图像聚类之外,还可以按照其他标准对病理切片图像进行图像聚类。例如,按照质量类别对病理切片图像进行图像聚类,例如质量类别包括染色不均、切片厚、震刀或者切片皱折等。或者按照细胞类别对病理切片图像进行图像聚类,例如细胞类别包括可疑细胞和正常细胞等。
图11是本申请实施例提供的一种图像聚类装置的结构示意图。参见图11, 该装置包括:
第一参数确定模块1101,用于基于M个图像组,确定第一聚类参数,第一聚类参数表示M个图像组中的图像的聚类程度,M为大于1的整数;
第二参数确定模块1102,用于对于M个图像组中的任一目标图像组,将目标图像组划分成两个图像组,得到M+1个参考图像组,将基于M+1个参考图像组确定的参考聚类参数确定为目标图像组的第二聚类参数,第二聚类参数表示M+1个参考图像组中的图像的聚类程度;
图像组划分模块1103,用于在目标第二聚类参数表示的聚类程度不低于第一聚类参数表示的聚类程度的情况下,将目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;目标第二聚类参数为M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
本申请实施例提供的图像聚类装置,分别确定将M个图像组中的每个图像组划分成两个新的图像组后的第二聚类参数,如果目标第二聚类参数表示的聚类程度不低于划分前的第一聚类参数表示的聚类程度,则说明将该目标第二聚类参数对应的图像组划分成两个新的图像组,能够提高图像组中的图像的聚类程度,因此将该图像组划分成两个新的图像组,得到M+1个图像组,实现了对M个图像组继续进行细分,有利于进一步区分易混淆的图像,从而提高图像聚类的聚类程度。
可选地,参见图12,第二参数确定模块1102,还用于:
对于M+1个图像组中的任一目标图像组,将目标图像组划分成两个图像组,得到M+2个参考图像组,将基于M+2个参考图像组确定的参考聚类参数确定为目标图像组的第三聚类参数,第三聚类参数表示M+2个参考图像组中的图像的聚类程度;
图像组划分模块1103,还用于在目标第三聚类参数表示的聚类程度不低于目标第二聚类参数表示的聚类程度的情况下,将目标第三聚类参数对应的目标图像组划分成两个图像组,得到M+2个图像组;目标第三聚类参数为M+1个图像组各自的第三聚类参数中所表示的聚类程度最高的第三聚类参数;以及,在目标第三聚类参数表示的聚类程度低于目标第二聚类参数表示的聚类程度的情况下,确定完成对于图像组的图像聚类处理。
可选地,参见图12,装置还包括:
图像获取模块1104,用于获取对目标对象进行拍摄得到的多个图像;
分类处理模块1105,用于调用图像分类模型,分别对多个图像进行分类处理,得到每个图像的类别标签;
图像划分模块1106,用于基于多个图像各自的类别标签,将相同类别的图像划分到同一个图像组中,得到M个图像组。
可选地,参见图12,图像分类模型包括第一特征提取网络和图像分类网络,分类处理模块1105,包括:
第一特征提取单元1115,用于对于多个图像中的每个图像,调用第一特征提取网络,对图像进行特征提取,得到第一图像特征;
分类处理单元1125,用于调用图像分类网络,基于第一图像特征进行分类处理,得到图像的类别标签。
可选地,参见图12,第一参数确定模块1101,包括:
第一参数确定单元1111,用于对于M个图像组中的每个图像,基于图像的第一图像特征、图像所属的图像组中的其他图像的第一图像特征、以及其他图像组中的图像的第一图像特征,确定图像对应的凝聚参数和分离参数,凝聚参数表示图像与图像所属的图像组中的其他图像之间的不相似程度,分离参数表示图像与其他图像组中的图像之间的不相似程度;
第二参数确定单元1121,用于基于凝聚参数和分离参数,确定图像对应的聚类子参数,聚类子参数与凝聚参数负相关,聚类子参数与分离参数正相关。
第三参数确定单元1131,用于基于所述M个图像组中各个图像各自对应的聚类子参数,确定第一聚类参数。
可选地,参见图12,图像为病理切片图像,第一特征提取网络包括K个特征提取层和特征转换层,第一特征提取单元1115,用于:
调用K个特征提取层,对图像依次进行特征提取,得到每个特征提取层输出的图像特征;
调用特征转换层,对最后L个特征提取层输出的图像特征进行特征转换,得到第一图像特征,L为大于1且不大于K的整数。
可选地,参见图12,装置还包括:
样本图像获取模块1107,用于获取样本图像;
扰动处理模块1108,用于对样本图像分别采用不同的方式进行扰动处理,得到多个扰动图像;
分类处理模块1105,还用于调用待训练的图像分类模型,分别对每个扰动图像进行分类处理,得到每个扰动图像的类别标签;
模型训练模块1109,用于基于每个扰动图像的类别标签,训练图像分类模型。
可选地,参见图12,样本图像的数量为多个,扰动图像的类别标签包括扰动图像属于每个类别的概率,模型训练模块1109,包括:
第一差异参数确定单元1119,用于获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第一差异参数;
第二差异参数确定单元1129,用于获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第二差异参数;
第一模型训练单元1139,用于基于第一差异参数与第二差异参数,训练图像分类模型,以使调用训练后的图像分类模型得到的第一差异参数减小,且第二差异参数增大。
可选地,参见图12,图像分类模型包括第一特征提取网络和图像分类网络,分类处理模块1105,包括:
第一特征提取单元1115,用于对于每个扰动图像,调用第一特征提取网络,对扰动图像进行特征提取,得到第二图像特征;
分类处理单元1125,用于调用图像分类网络,基于第二图像特征进行分类处理,得到扰动图像的类别标签。
可选地,参见图12,图像分类模型还包括第二特征提取网络,分类处理模块1105,还包括:
第二特征提取单元1135,用于调用第二特征提取网络,对第二图像特征进行特征提取,得到第三图像特征;
模型训练模块1109,包括:
第二模型训练单元1149,用于基于每个扰动图像的第三图像特征,训练图像分类模型。
可选地,参见图12,样本图像的数量为多个,第二模型训练单元1149,用于:
获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第三差异参数;
获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第四差异参数;
基于第三差异参数与第四差异参数,训练图像分类模型,以使调用训练后的图像分类模型得到的第三差异参数减小,且第四差异参数增大。
需要说明的是:上述实施例提供的图像聚类装置在进行图像聚类时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将计算机设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图像聚类装置与图像聚类方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
本申请实施例还提供了一种计算机设备,该计算机设备包括处理器和存储器,存储器中存储有至少一条计算机程序,该至少一条计算机程序由处理器加载并执行,以实现上述实施例的图像聚类方法中所执行的操作。
可选地,该计算机设备提供为终端。图13示出了本申请一个示例性实施例提供的终端1300的结构示意图。
终端1300包括有:处理器1301和存储器1302。
处理器1301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(FieldProgrammable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1301可以集成有GPU(Graphics Processing Unit,图像处理的交互器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器1302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1302中的非暂态的计算机可读存储介质用于存储至少一条计算机程序,该至少一条计算机程序用于被处理器1301所具有以实现本申请中方法实施例提供的图像聚类方法。
在一些实施例中,终端1300还可选包括有:外围设备接口1303和至少一个外围设备。处理器1301、存储器1302和外围设备接口1303之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口1303相连。可选地,外围设备包括:射频电路1304、显示屏1305、摄像头组件1306、音频电路1307、定位组件1308和电源1309中的至少一种。
在一些实施例中,终端1300还包括有一个或多个传感器1310。该一个或多个传感器1310包括但不限于:加速度传感器1311、陀螺仪传感器1312、压力传感器1313、指纹传感器1314、光学传感器1315以及接近传感器1316。
本领域技术人员可以理解,图13中示出的结构并不构成对终端1300的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
可选地,该计算机设备提供为服务器。图14是本申请实施例提供的一种服务器的结构示意图,该服务器1400可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1401和一个或一个以上的存储器1402,其中,所述存储器1402中存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器1401加载并执行以实现上述各个方法实施例提供的方法。当然,该服务器还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有至少一条计算机程序,该至少一条计算机程序由处理器加载并执行,以实现上述实施例的图像聚类方法中所执行的操作。
本申请实施例还提供了一种计算机程序产品或计算机程序,计算机程序产品或计算机程序包括计算机程序代码,计算机程序代码存储在计算机可读存储介质中,计算机设备的处理器从计算机可读存储介质读取计算机程序代码,处理器执行计算机程序代码,使得计算机设备实现如上述实施例的图像聚类方法中所执行的操作。在一些实施例中,本申请实施例所涉及的计算机程序可被部署在一个计算机设备上执行,或者在位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链系统。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请实施例的可选实施例,并不用以限制本申请实施例,凡在本申请实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (16)

  1. 一种图像聚类方法,由计算机设备执行,所述方法包括:
    基于M个图像组,确定第一聚类参数,所述第一聚类参数表示所述M个图像组中的图像的聚类程度,所述M为大于1的整数;
    对于所述M个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+1个参考图像组,将基于所述M+1个参考图像组确定的参考聚类参数确定为所述目标图像组的第二聚类参数,所述第二聚类参数表示所述M+1个参考图像组中的图像的聚类程度;
    在目标第二聚类参数表示的聚类程度不低于所述第一聚类参数表示的聚类程度的情况下,将所述目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;所述目标第二聚类参数为所述M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
  2. 根据权利要求1所述的方法,所述将所述目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组之后,所述方法还包括:
    对于所述M+1个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+2个参考图像组,将基于所述M+2个参考图像组确定的参考聚类参数确定为所述目标图像组的第三聚类参数,所述第三聚类参数表示所述M+2个参考图像组中的图像的聚类程度;
    在目标第三聚类参数表示的聚类程度不低于所述目标第二聚类参数表示的聚类程度的情况下,将所述目标第三聚类参数对应的目标图像组划分成两个图像组,得到M+2个图像组;所述目标第三聚类参数为所述M+1个图像组各自的第三聚类参数中所表示的聚类程度最高的第三聚类参数;
    在所述目标第三聚类参数表示的聚类程度低于所述目标第二聚类参数表示的聚类程度的情况下,确定完成对于图像组的图像聚类处理。
  3. 根据权利要求1所述的方法,所述基于M个图像组,确定第一聚类参数之前,所述方法还包括:
    获取对目标对象进行拍摄得到的多个图像;
    调用图像分类模型,分别对所述多个图像进行分类处理,得到每个图像的类别标签;
    基于所述多个图像各自的类别标签,将相同类别的图像划分到同一个图像组中,得到所述M个图像组。
  4. 根据权利要求3所述的方法,所述图像分类模型包括第一特征提取网络和图像分类网络,所述调用图像分类模型,分别对所述多个图像进行分类处理,得到每个图像的类别标签,包括:
    对于所述多个图像中的每个图像,调用所述第一特征提取网络,对所述图像进行特征提取,得到第一图像特征;
    调用所述图像分类网络,基于所述第一图像特征进行分类处理,得到所 述图像的类别标签。
  5. 根据权利要求4所述的方法,所述基于M个图像组,确定第一聚类参数,包括:
    对于所述M个图像组中的每个图像,基于所述图像的第一图像特征、所述图像所属的图像组中的其他图像的第一图像特征、以及其他图像组中的图像的第一图像特征,确定所述图像对应的凝聚参数和分离参数,所述凝聚参数表示所述图像与所述图像所属的图像组中的其他图像之间的不相似程度,所述分离参数表示所述图像与所述其他图像组中的图像之间的不相似程度;
    基于所述凝聚参数和所述分离参数,确定所述图像对应的聚类子参数,所述聚类子参数与所述凝聚参数负相关,所述聚类子参数与所述分离参数正相关;
    基于所述M个图像组中各个图像各自对应的聚类子参数,确定所述第一聚类参数。
  6. 根据权利要求4所述的方法,所述图像为病理切片图像,所述第一特征提取网络包括K个特征提取层和特征转换层,所述调用所述第一特征提取网络,对所述图像进行特征提取,得到第一图像特征,包括:
    调用所述K个特征提取层,对所述图像依次进行特征提取,得到每个特征提取层输出的图像特征;
    调用所述特征转换层,对最后L个特征提取层输出的图像特征进行特征转换,得到所述第一图像特征,所述L为大于1且不大于所述K的整数。
  7. 根据权利要求3所述的方法,所述图像分类模型的训练过程包括:
    获取样本图像;
    对所述样本图像分别采用不同的方式进行扰动处理,得到多个扰动图像;
    调用待训练的图像分类模型,分别对每个扰动图像进行分类处理,得到每个扰动图像的类别标签;
    基于每个扰动图像的所述类别标签,训练所述图像分类模型。
  8. 根据权利要求7所述的方法,所述样本图像的数量为多个,所述扰动图像的类别标签包括所述扰动图像属于每个类别的概率,所述基于每个扰动图像的所述类别标签,训练所述图像分类模型,包括:
    获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第一差异参数;
    获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像属于同一类别的概率之间的第二差异参数;
    基于所述第一差异参数与所述第二差异参数,训练所述图像分类模型,以使调用训练后的图像分类模型得到的第一差异参数减小,且第二差异参数增大。
  9. 根据权利要求7所述的方法,所述图像分类模型包括第一特征提取网 络和图像分类网络,所述调用待训练的图像分类模型,分别对每个扰动图像进行分类处理,得到每个扰动图像的类别标签,包括:
    对于每个扰动图像,调用所述第一特征提取网络,对所述扰动图像进行特征提取,得到第二图像特征;
    调用所述图像分类网络,基于所述第二图像特征进行分类处理,得到所述扰动图像的类别标签。
  10. 根据权利要求9所述的方法,所述图像分类模型还包括第二特征提取网络,所述方法还包括:
    调用所述第二特征提取网络,对所述第二图像特征进行特征提取,得到第三图像特征;
    基于每个扰动图像的所述第三图像特征,训练所述图像分类模型。
  11. 根据权利要求10所述的方法,所述样本图像的数量为多个,所述基于每个扰动图像的所述第三图像特征,训练所述图像分类模型,包括:
    获取对同一样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第三差异参数;
    获取对不同样本图像进行扰动处理得到的多个扰动图像,确定获取到的多个扰动图像的第三图像特征之间的第四差异参数;
    基于所述第三差异参数与所述第四差异参数,训练所述图像分类模型,以使调用训练后的图像分类模型得到的第三差异参数减小,且第四差异参数增大。
  12. 一种图像聚类装置,所述装置包括:
    第一参数确定模块,用于基于M个图像组,确定第一聚类参数,所述第一聚类参数表示所述M个图像组中的图像的聚类程度,所述M为大于1的整数;
    第二参数确定模块,用于对于所述M个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+1个参考图像组,将基于所述M+1个参考图像组确定的参考聚类参数确定为所述目标图像组的第二聚类参数,所述第二聚类参数表示所述M+1个参考图像组中的图像的聚类程度;
    图像组划分模块,用于在目标第二聚类参数表示的聚类程度不低于所述第一聚类参数表示的聚类程度的情况下,将所述目标第二聚类参数对应的目标图像组划分成两个图像组,得到M+1个图像组;所述目标第二聚类参数为所述M个图像组各自的第二聚类参数中所表示的聚类程度最高的第二聚类参数。
  13. 根据权利要求12所述的装置,所述第二参数确定模块,还用于:
    对于所述M+1个图像组中的任一目标图像组,将所述目标图像组划分成两个图像组,得到M+2个参考图像组,将基于所述M+2个参考图像组确定的参考聚类参数确定为所述目标图像组的第三聚类参数,所述第三聚类参数 表示所述M+2个参考图像组中的图像的聚类程度;
    所述图像组划分模块,还用于在目标第三聚类参数表示的聚类程度不低于所述目标第二聚类参数表示的聚类程度的情况下,将所述目标第三聚类参数对应的目标图像组划分成两个图像组,得到M+2个图像组;所述目标第三聚类参数为所述M+1个图像组各自的第三聚类参数中所表示的聚类程度最高的第三聚类参数;以及,在所述目标第三聚类参数表示的聚类程度低于所述目标第二聚类参数表示的聚类程度的情况下,确定完成对于图像组的图像聚类处理。
  14. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器加载并执行,以实现如权利要求1至11任一项所述的图像聚类方法中所执行的操作。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条计算机程序,所述至少一条计算机程序由处理器加载并执行,以实现如权利要求1至11任一项所述的图像聚类方法中所执行的操作。
  16. 一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机实现如权利要求1至11中任一项所述的图像聚类方法。
PCT/CN2022/099660 2021-08-09 2022-06-20 图像聚类方法、装置、计算机设备及存储介质 WO2023016087A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP22855072.9A EP4293631A1 (en) 2021-08-09 2022-06-20 Method and apparatus for image clustering, computer device, and storage medium
JP2023552569A JP2024508867A (ja) 2021-08-09 2022-06-20 画像クラスタリング方法、装置、コンピュータ機器及びコンピュータプログラム
US18/135,880 US20230298314A1 (en) 2021-08-09 2023-04-18 Image clustering method and apparatus, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110907973.3A CN114283299A (zh) 2021-08-09 2021-08-09 图像聚类方法、装置、计算机设备及存储介质
CN202110907973.3 2021-08-09

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/135,880 Continuation US20230298314A1 (en) 2021-08-09 2023-04-18 Image clustering method and apparatus, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023016087A1 true WO2023016087A1 (zh) 2023-02-16

Family

ID=80868406

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099660 WO2023016087A1 (zh) 2021-08-09 2022-06-20 图像聚类方法、装置、计算机设备及存储介质

Country Status (5)

Country Link
US (1) US20230298314A1 (zh)
EP (1) EP4293631A1 (zh)
JP (1) JP2024508867A (zh)
CN (1) CN114283299A (zh)
WO (1) WO2023016087A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114283299A (zh) * 2021-08-09 2022-04-05 腾讯科技(深圳)有限公司 图像聚类方法、装置、计算机设备及存储介质
CN115294639B (zh) * 2022-07-11 2023-07-07 惠州市慧昊光电有限公司 色温可调灯带及其控制方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012048641A (ja) * 2010-08-30 2012-03-08 Nikon Systems Inc 画像分類装置、画像分類プログラム、プリンタ、撮像装置及び携帯電話機
CN107943984A (zh) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 图像处理方法、装置、计算机设备和计算机可读存储介质
CN108268526A (zh) * 2016-12-30 2018-07-10 中国移动通信集团北京有限公司 一种数据分类方法和装置
CN109447186A (zh) * 2018-12-13 2019-03-08 深圳云天励飞技术有限公司 聚类方法及相关产品
CN110796164A (zh) * 2019-09-20 2020-02-14 北京海益同展信息科技有限公司 数据聚类的簇数确定方法、系统、电子设备及存储介质
WO2021029835A1 (en) * 2019-08-09 2021-02-18 Bilkav Eğitim Danişmanlik A.Ş. A method and system for clustering performance evaluation and increment
CN114283299A (zh) * 2021-08-09 2022-04-05 腾讯科技(深圳)有限公司 图像聚类方法、装置、计算机设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012048641A (ja) * 2010-08-30 2012-03-08 Nikon Systems Inc 画像分類装置、画像分類プログラム、プリンタ、撮像装置及び携帯電話機
CN108268526A (zh) * 2016-12-30 2018-07-10 中国移动通信集团北京有限公司 一种数据分类方法和装置
CN107943984A (zh) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 图像处理方法、装置、计算机设备和计算机可读存储介质
CN109447186A (zh) * 2018-12-13 2019-03-08 深圳云天励飞技术有限公司 聚类方法及相关产品
WO2021029835A1 (en) * 2019-08-09 2021-02-18 Bilkav Eğitim Danişmanlik A.Ş. A method and system for clustering performance evaluation and increment
CN110796164A (zh) * 2019-09-20 2020-02-14 北京海益同展信息科技有限公司 数据聚类的簇数确定方法、系统、电子设备及存储介质
CN114283299A (zh) * 2021-08-09 2022-04-05 腾讯科技(深圳)有限公司 图像聚类方法、装置、计算机设备及存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHEN LI-FEI: "A Hierarchical Method for Determining the Number of Clusters", JOURNAL OF SOFTWARE, vol. 19, no. 1, 30 June 2008 (2008-06-30), pages 62 - 72, XP093035466, ISSN: 1000-9825, DOI: 10.3724/SP.J.1001.2008.00062 *
HALKIDI M., VAZIRGIANNIS M.: "Clustering validity assessment: finding the optimal partitioning of a data set", DATA MINING, 2001. ICDM 2001, PROCEEDINGS IEEE INTERNATIONAL CONFERENC E ON SAN JOSE, CA, USA 29 NOV.-2 DEC. 2001, LOS ALAMITOS, CA, USA,IEEE COMPUT. SOC, US, 29 November 2001 (2001-11-29) - 2 December 2001 (2001-12-02), US , pages 187 - 194, XP010583276, ISBN: 978-0-7695-1119-1, DOI: 10.1109/ICDM.2001.989517 *

Also Published As

Publication number Publication date
JP2024508867A (ja) 2024-02-28
US20230298314A1 (en) 2023-09-21
CN114283299A (zh) 2022-04-05
EP4293631A1 (en) 2023-12-20

Similar Documents

Publication Publication Date Title
US11373305B2 (en) Image processing method and device, computer apparatus, and storage medium
US20230037908A1 (en) Machine learning model training method and device, and expression image classification method and device
WO2023016087A1 (zh) 图像聚类方法、装置、计算机设备及存储介质
US10535141B2 (en) Differentiable jaccard loss approximation for training an artificial neural network
CN111931592B (zh) 对象识别方法、装置及存储介质
WO2018052586A1 (en) Method and system for multi-scale cell image segmentation using multiple parallel convolutional neural networks
CN108804641A (zh) 一种文本相似度的计算方法、装置、设备和存储介质
WO2022042123A1 (zh) 图像识别模型生成方法、装置、计算机设备和存储介质
CN107633522A (zh) 基于局部相似性活动轮廓模型的脑部图像分割方法和系统
US20230237771A1 (en) Self-supervised learning method and apparatus for image features, device, and storage medium
CN110175249A (zh) 一种相似图片的检索方法及系统
CN116580257A (zh) 特征融合模型训练及样本检索方法、装置和计算机设备
WO2023020214A1 (zh) 检索模型的训练和检索方法、装置、设备及介质
CN111340213B (zh) 神经网络的训练方法、电子设备、存储介质
CN110909817B (zh) 分布式聚类方法及系统、处理器、电子设备及存储介质
CN112633340B (zh) 目标检测模型训练、检测方法、设备及存储介质
CN109948422A (zh) 一种室内环境调节方法、装置、可读存储介质及终端设备
WO2021041342A1 (en) Semantic image retrieval for whole slide images
WO2022127333A1 (zh) 图像分割模型的训练方法、图像分割方法、装置、设备
CN114758130B (zh) 图像处理及模型训练方法、装置、设备和存储介质
CN112069885A (zh) 人脸属性识别方法、装置及移动终端
CN112214639A (zh) 视频筛选方法、视频筛选装置及终端设备
CN111625672B (zh) 图像处理方法、装置、计算机设备及存储介质
CN116189209B (zh) 医疗文档图像分类方法和装置、电子设备和存储介质
CN117422671A (zh) 一种医学图像检测方法、系统、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22855072

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023552569

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 2022855072

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022855072

Country of ref document: EP

Effective date: 20230914

NENP Non-entry into the national phase

Ref country code: DE