WO2021120752A1 - Region-based self-adaptive model training method and device, image detection method and device, and apparatus and medium - Google Patents

Region-based self-adaptive model training method and device, image detection method and device, and apparatus and medium Download PDF

Info

Publication number
WO2021120752A1
WO2021120752A1 PCT/CN2020/116742 CN2020116742W WO2021120752A1 WO 2021120752 A1 WO2021120752 A1 WO 2021120752A1 CN 2020116742 W CN2020116742 W CN 2020116742W WO 2021120752 A1 WO2021120752 A1 WO 2021120752A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
domain
model
image
global
Prior art date
Application number
PCT/CN2020/116742
Other languages
French (fr)
Chinese (zh)
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 平安科技(深圳)有限公司
Publication of WO2021120752A1 publication Critical patent/WO2021120752A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • 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/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • 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/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/467Encoded features or binary features, e.g. local binary patterns [LBP]

Definitions

  • This application relates to the field of artificial intelligence classification models, and in particular to a domain adaptive model training, image detection methods, devices, computer equipment, and storage media.
  • OCT Optical Coherence Tomography
  • This application provides a domain adaptive model training, image detection method, device, computer equipment, and storage medium, which realizes that there is no need to manually label images in the target domain, and by adaptively aligning the distribution differences of image data from different domain sources, Improve the training efficiency of the domain adaptive model, and introduce the feature regular loss value, improve the robustness and accuracy of the domain adaptive model, and automatically identify the category of the target domain image through the domain adaptive model, realizing cross-domain Image detection improves the reliability of recognition and saves costs.
  • a domain adaptive model training method including:
  • the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
  • the image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample;
  • the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
  • An image detection method including:
  • the image detection instruction is received, and the image of the target area to be detected is obtained;
  • the image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
  • a domain adaptive model training device including:
  • the acquisition module is used to acquire an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample, one category label, and one domain Label association; one image sample of the target domain is associated with one domain label;
  • the input module is used to input the image sample into a Faster-RCNN-based domain adaptive model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample;
  • the domain adaptive model Including the preprocessing model, feature extraction model, region extraction model, detection model, global feature model, and local feature model;
  • An extraction module configured to perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector image
  • the first loss module is used to perform region extraction and equal sampling of the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform region feature vector maps corresponding to the image samples Perform local feature extraction processing and binary classification recognition to obtain a local domain classification result, and obtain a local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the global feature model is used to The feature vector graph performs regularization and global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and according to the global domain classification result and the domain label corresponding to the feature vector graph, a global feature alignment loss is obtained value;
  • the second loss module is used to perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain the recognition result, and according to the recognition result and the source domain
  • the category label corresponding to the domain image sample obtains the detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value, a total loss value is obtained;
  • the training module is configured to iteratively update the initial parameters of the domain adaptive model when the total loss value does not reach the preset convergence condition, until the total loss value reaches the preset convergence condition, it will converge
  • the subsequent domain adaptive model is recorded as a trained domain adaptive model.
  • An image detection device includes:
  • the receiving module is used to receive the image detection instruction and obtain the image of the target area to be detected
  • the detection module is used to input the image of the target domain to be detected into the image detection model trained as the above-mentioned domain adaptive model training method, extract the image features in the image of the target domain to be detected through the image detection model, and obtain all the images of the target domain.
  • the image detection model outputs a source domain category result according to the image feature.
  • a computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
  • the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
  • the image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample;
  • the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
  • a computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor further implements the following steps when the processor executes the computer-readable instructions:
  • the image detection instruction is received, and the image of the target area to be detected is obtained;
  • the image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
  • One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
  • the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
  • the image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample;
  • the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
  • One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
  • the image detection instruction is received, and the image of the target area to be detected is obtained;
  • the image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
  • the domain adaptive model training method, device, computer equipment, and storage medium obtained an image sample set containing multiple image samples; the image samples include source domain image samples and target domain image samples;
  • the sample input contains initial parameters and is based on a Faster-RCNN-based domain adaptive model.
  • the image sample is image converted by the preprocessing model to obtain the preprocessed image sample; the preprocessed image is imaged by the feature extraction model Extract and obtain a feature vector map; perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform a regional feature vector map corresponding to the image sample Perform local feature extraction processing and binary classification recognition to obtain local feature alignment loss values; at the same time, perform regularization and global feature recognition processing on the feature vector graph through the global feature model to obtain feature regularization loss values and global feature alignment loss values Perform boundary regression and source domain classification and recognition on the regional feature vector map corresponding to the source domain image sample through the detection model to obtain the detection loss value; according to the global feature alignment loss value, the detection loss value, and the The local feature alignment loss value and the feature regular loss value are used to obtain the total loss value; when the total loss value does not reach the preset convergence condition, the initial parameters are iteratively updated until convergence, and the trained domain adaptive model is obtained, Therefore, this application provides
  • the image samples of the domain are trained, and the domain adaptive model based on Faster-RCNN is converged according to the total loss value containing the global feature alignment loss value, detection loss value, local feature alignment loss value and feature regular loss value.
  • Cross-domain image recognition improves the accuracy and reliability of image recognition and saves labor costs.
  • the image detection method, device, computer equipment and storage medium provided in this application receive the image detection instruction and obtain the image of the target domain to be detected; input the image of the target domain to be detected into the training completed by the above-mentioned domain adaptive model training method
  • the image detection model extracts the image features in the image of the target domain to be detected through the image detection model, and obtains the source domain category results output by the image detection model according to the image features.
  • this application adopts the domain adaptive model
  • the category of the target domain image is automatically recognized, cross-domain image detection is realized, the recognition reliability is improved, and the cost is saved.
  • FIG. 1 is a schematic diagram of an application environment of a domain adaptive model training method or an image detection method in an embodiment of the present application
  • FIG. 2 is a flowchart of a method for training a domain adaptive model in an embodiment of the present application
  • FIG. 3 is a flowchart of step S20 of a domain adaptive model training method in an embodiment of the present application
  • step S40 is a flowchart of step S40 of the method for training a domain adaptive model in an embodiment of the present application
  • FIG. 5 is a flowchart of step S40 of a method for training a domain adaptive model in another embodiment of the present application
  • FIG. 6 is a flowchart of step S40 of the domain adaptive model training method in another embodiment of the present application.
  • Fig. 7 is a flowchart of an image detection method in an embodiment of the present application.
  • Fig. 8 is a functional block diagram of a domain adaptive model training device in an embodiment of the present application.
  • Fig. 9 is a functional block diagram of an image detection device in an embodiment of the present application.
  • Fig. 10 is a schematic diagram of a computer device in an embodiment of the present application.
  • the domain adaptive model training method provided by this application can be applied in an application environment as shown in Fig. 1, where a client (computer device) communicates with a server through a network.
  • the client computer equipment
  • the server includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices.
  • the server can be implemented as an independent server or a server cluster composed of multiple servers.
  • a method for training a domain adaptive model is provided, and its technical solution mainly includes the following steps S10-S60:
  • an image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; An image sample of the target domain is associated with a domain label.
  • receiving a training request for a domain adaptive model triggers the acquisition of the image sample set used to train the domain adaptive model, the image sample set being a collection of the collected image samples, and the image samples include There are the source domain image sample and the target domain image sample, the source domain image sample is an image collected in a known field or by a known device and marked with a category label, and the category label indicates all
  • the category of the source domain image sample for example, an OCT image sample is collected on a known OCT acquisition device, and the OCT image sample has been marked with the category label of the area contained in the OCT image sample (choroidal area, macular hole) Region, etc.), one of the source domain image samples is associated with a category label and a domain label, the domain label serves as a distinguishing identifier between the source domain image sample and the target domain image sample, and the domain label includes the source
  • the domain label and the target domain label for example, the label includes a model label (source domain label) corresponding to a known device and a model label (target domain label
  • the domain adaptive model includes the Preprocessing model, feature extraction model, region extraction model, detection model, global feature model and local feature model.
  • the domain adaptive model is a neural network model based on Faster-RCNN for image target detection
  • the domain adaptive model includes the initial parameters
  • the initial parameters include the network structure and individual parameters of the domain adaptive model.
  • the parameters of the model, the network structure of the domain adaptive model includes the network structure of Faster-RCNN
  • the preprocessing model is to perform image conversion on the input image sample to convert the preprocessed image sample
  • the image The conversion is an image processing process that performs size parameter and pixel enhancement on the image.
  • the process can be set according to requirements. For example, image conversion includes scaling the input image into an image with preset size parameters, and performing image enhancement on the scaled image , And perform pixel enhancement operations on the converted image samples.
  • the domain adaptive model includes a preprocessing model, a feature extraction model, a region extraction model, a detection model, a global feature model, and a local feature model.
  • step S20 that is, the image conversion is performed on the image sample through the preprocessing model to obtain the preprocessed image sample, including:
  • S201 Perform size matching on the image sample through the preprocessing model according to a preset size parameter to obtain a matching image sample.
  • the size of the image sample varies according to different collection devices, and the image sample needs to be image converted through the preprocessing model to obtain an image in a unified format, and the size parameters are set according to requirements
  • the size parameter includes the length, width, and number of channels of the image, the number of channels is the number of channels after the image sample is converted, and the preprocessing model converts the image sample into the Matching an image sample
  • the size matching is an image that performs scaling processing, merging processing, or scaling and merging processing on the image sample to meet the requirements of the size parameter, for example, the size of the image sample is 600 ⁇ 800 with three channels
  • the size parameter of the image is (600 ⁇ 600, 3), then the size of the matched image sample obtained after the size matching process is a 600 ⁇ 600 image with three channels.
  • S202 Perform denoising and image enhancement processing on the matched image sample through the preprocessing model according to the gamma transformation algorithm to obtain the preprocessed image sample.
  • the preprocessing model reduces image noise on the matched image samples
  • the denoising processing can be set according to requirements.
  • the denoising processing can be median filtering denoising, Gaussian filtering denoising, and mean filtering.
  • Denoising, Wiener filtering denoising or Fourier filtering denoising, etc. through the preprocessing model, perform image enhancement processing on the matched image samples after denoising, and finally obtain the preprocessed image samples.
  • the image enhancement processing is the processing operation of using the gamma transformation algorithm to enhance each pixel in the matched image sample after denoising.
  • the gamma transformation algorithm is to correct the image and transform the gray scale of the image. An algorithm for correcting images with high or low gray levels to enhance contrast.
  • the image features are extracted from the preprocessed image
  • the image features are color features, texture features, shape features, and spatial relationship features in the image
  • the feature extraction model includes the network structure of Faster-RCNN
  • the feature is extracted to obtain the feature vector graph, which is a matrix of multi-channel (also multi-dimensional) and containing vectors of the image features.
  • S40 Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; perform local feature extraction processing on the region feature vector map corresponding to the image sample through the local feature model And two-class recognition to obtain a local domain classification result, and obtain a local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the global feature model is used to compare the feature vector map Perform regularization and global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph.
  • the region extraction model is also called a region generation network (RPN, Region Proposal Network).
  • the region extraction model performs region extraction and equalization sampling processing on the feature vector graph, and the region extraction is derived from the features
  • a plurality of candidate area frames are extracted from the vector graph.
  • the candidate area frame is a target area (also a target area of interest) that contains an anchor that meets the preset requirements, and the equalized sampling is performed for all the candidates
  • the region box is mapped to the feature vector map, and the candidate region box is mapped to the region in the feature vector map to perform ROI Pooling processing to obtain the region feature vector map of the same size
  • the purpose of the balanced sampling is to pool candidate regions of different sizes into the same size region feature vector map.
  • the local feature model extracts local features in the region feature vector graph, and the local feature extraction process is to extract features of the same nature in the information hidden in the local region, such as edge points or lines, to obtain A plurality of local feature vector graphs, and then perform binary classification recognition on all the local feature vector graphs through the local feature model, that is, to identify whether the local feature vector graph is the source domain label result or the target domain label result through the binary classification method, the
  • the local domain classification result includes a local source domain label result and a local target domain label result, and the local domain classification result also includes identifying a probability value corresponding to the local source domain label result and a probability value corresponding to the local target domain label result, Calculate according to the local domain classification result and the domain label corresponding to the input image sample corresponding to the local domain classification result to obtain a local feature alignment loss value, and perform back propagation through the local feature alignment loss value, Adjust the parameters in the local feature model, and continuously align the local features in the source domain image sample and the local feature in the target domain image sample through the local
  • the global feature model performs a regularization process on the feature vector graph, and performs a global feature recognition process on the regularized feature vector graph
  • the global feature recognition process is the regularized feature Perform global feature extraction on the vector graph, classify and recognize the regularized feature vector graph according to the extracted global feature
  • the classification recognition is binary classification recognition
  • the feature vector graph of obtains the feature regular loss value
  • the feature regular loss value can minimize the loss processing on the extracted global feature to prevent overfitting
  • the global domain classification result includes the global source domain label result
  • the global domain classification result further includes identifying the probability value corresponding to the global domain label result and the probability value corresponding to the global target domain label result, according to the global domain classification result and the feature
  • the gap between the domain labels corresponding to the vector graph is used to obtain the global feature alignment loss value.
  • the global feature alignment loss value is used for backpropagation, the parameters in the global feature model are adjusted, and the global feature alignment loss value is continuously updated.
  • the global features in the image samples of the source domain and the global features in the target domain image samples are aligned with each other to reduce the difference between the global features. That is, by extracting the global features from the source domain image samples, it is used to compare the target domain image samples. Perform two-class recognition and effective global features, extract from the global features in the target domain image samples the effective global features for the source domain image samples for classification and recognition, the global features are in the regularized feature vector image
  • the embodied color feature, texture feature, and shape feature can represent the relevant features of the overall object.
  • the step S40 that is, the performing region extraction and equalization sampling on the feature vector map through the region extraction model to obtain a region feature vector map includes:
  • S401 Perform region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame.
  • the region extraction model includes a region extraction network layer and a region of interest pooling layer
  • the region extraction network layer includes a 3 ⁇ 3 convolution layer, an activation layer, and two 1 ⁇ 3 layers with different dimensional parameters.
  • 1 convolutional layer, a softmax layer, and a fully connected layer the region is extracted as the first feature map obtained by convolution of the feature vector map through a 3 ⁇ 3 convolutional layer, and the first feature map is respectively Input the first 1 ⁇ 1 convolutional layer and the second 1 ⁇ 1 convolutional layer to obtain the second feature map and the third feature map of different dimensions, and the second feature map is anchored through the softmax layer.
  • the third feature map and the second feature map after passing through the softmax layer are classified through the fully connected layer, and locked through bbox regression, and finally at least one feature map is output The candidate area frame.
  • S402 Perform equal sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
  • the region of interest pooling layer is also called ROI pooling, and the region of interest pooling layer maps all the candidate region boxes to the target in the feature vector diagram corresponding to the target in the candidate region box
  • the position of, that is, the region position that is the same as the vector value of the candidate region frame is queried from the feature vector map, and the region corresponding to the candidate region frame in the mapped feature vector map is preset
  • the fixed-size pooling process can pool the regions corresponding to each of the candidate region frames to obtain the region feature vector map of the same size. In this way, it is possible to obtain all the regions of the same size corresponding to each candidate region frame.
  • the area feature vector diagram is also called ROI pooling, and the region of interest pooling layer maps all the candidate region boxes to the target in the feature vector diagram corresponding to the target in the candidate region box.
  • This application realizes the area extraction of the feature vector graph through the area extraction network layer to obtain the candidate area frame; the area of interest pool layer is used to perform equal sampling processing on the feature vector graph and all the candidate area frames to obtain the area
  • the feature vector map in this way, realizes that the region extraction network layer and the region of interest pool layer can automatically identify interesting or useful regions from the feature vector map, and convert them into the same size that is convenient for subsequent feature extraction
  • the regional feature vector map improves the recognition efficiency and accuracy, and avoids the interference of uninteresting or useless regions on feature extraction.
  • the local feature extraction process and the two-class recognition are performed on the regional feature vector map corresponding to the image sample through the local feature model to obtain The local domain classification result, and the local feature alignment loss value obtained according to the local domain classification result and the domain label corresponding to the image sample, including:
  • S403 Perform local feature extraction on the regional feature vector map by using a feature extractor in the local feature model to obtain a local feature vector map.
  • the local feature model includes a feature extractor, a domain classifier, a gradient reversal layer, and a domain difference measurer.
  • the feature extractor performs the local feature extraction for each of the regional feature vector graphs, and the extraction method It can be set according to requirements, such as SIFT (Scale Invariant Feature Transform) method, SURF (Speeded Up Robust Features) method, Harris Corner method, and LBP (Local Binary Pattern) method.
  • the local feature The extraction method is the LBP method. Because the LBP method has the characteristics of rotation invariance and gray level invariance, it can extract the local features more effectively, and after processing by the feature extractor, multiple local feature vector images are obtained.
  • S404 Perform two-class recognition on the local feature vector graph by using a domain classifier in the local feature model to obtain the local domain classification result.
  • the goal of the domain classifier is to maximize the loss of the domain classifier, confuse the domain label recognition results of the target domain image sample and the source domain image sample, and let the local feature vector map corresponding to the source domain image sample
  • the two-class recognition output of the domain classifier is a local target domain label result, so that the local features can be aligned with each other.
  • S405 Perform reverse alignment on the local domain classification result through the gradient reversal layer in the local feature model to obtain a reverse domain label.
  • the gradient reversal layer is also referred to as a GRL (Gradient Reversal Layer) layer.
  • the reverse alignment means that the gradient direction is automatically reversed during the backward propagation process, and no processing is performed during the forward propagation process.
  • the local domain classification result is automatically inverted through the gradient reversal layer to obtain the reverse domain label opposite to the local domain classification result.
  • S406 Perform a difference comparison between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference metric in the local feature model to obtain the local feature alignment loss value.
  • the domain difference metric includes the local feature alignment loss function
  • the difference comparison is a loss value obtained through calculation of the local feature alignment loss function
  • the reverse domain label and the The domain label corresponding to the regional feature vector graph is input into the local feature alignment loss function to obtain the local feature alignment loss value
  • the local feature alignment loss value is:
  • p i,j is the pair corresponding to the same i-th image sample The reverse domain label corresponding to the j-th regional feature vector graph.
  • the present application realizes the local feature extraction of the regional feature vector graph by the feature extractor in the local feature model to obtain the local feature vector graph; the two-class recognition of the local feature vector graph by the domain classifier , Obtain the local domain classification result; perform inverse alignment on the local domain classification result through the gradient reversal layer to obtain a reverse domain label; align the loss function through the local feature in the domain difference measurer Calculate the loss of the reverse domain label and the domain label corresponding to the regional feature vector graph to obtain the local feature alignment loss value.
  • the local feature of the source domain image sample and the target domain image sample are automatically aligned
  • the said local features can effectively extract useful local features to identify the source domain image samples and target domain image samples, and reflect the local features of the source domain image samples and the target domain image samples through the local feature alignment loss value
  • the gap between the features, the local feature alignment loss value is continuously reduced in the process of iterating the initial parameters, which can improve the training efficiency of the model and improve the recognition accuracy and reliability.
  • the feature vector graph is regularized and the global feature recognition process is performed on the feature vector graph through the global feature model to obtain the feature regularization loss value and the global domain.
  • the classification result, and according to the global domain classification result and the domain label corresponding to the feature vector graph, the global feature alignment loss value is obtained, including:
  • S407 Perform regularization processing on the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature map, and at the same time calculate the feature regular loss value through the regular loss function in the feature regular model .
  • the feature regular model performs regularization processing on each of the feature vector graphs, and the regularization processing is to square and sum the feature vectors corresponding to each pixel in the feature vector graph, and then open the whole.
  • the processing operation of the square finally obtains the global regular feature map one-to-one corresponding to the feature vector map.
  • the feature vector corresponding to each pixel in each feature vector map can be made small, close to zero.
  • n is the total number of the image samples in the image sample set;
  • E i is the global canonical feature map corresponding to the i-th image sample (0 ⁇ i ⁇ n);
  • R is a preset Distance constant.
  • S408 Perform global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result.
  • the global feature extraction process is to perform histogram feature extraction on the feature vector corresponding to each pixel in the global regular feature map, and perform classification recognition based on the extracted global feature
  • the classification recognition is a two-category Method recognition, that is, the recognition result has only two classification results
  • the global domain classification result includes the global source domain label result and the global target domain label result
  • the global domain classification result also includes the probability value corresponding to the global domain label result. And the probability value corresponding to the global target domain label result.
  • the global loss model includes a global feature alignment loss function
  • the global feature alignment loss function is calculated by inputting the global domain classification result and the domain label corresponding to the feature vector graph into the global feature alignment loss function.
  • the feature alignment loss value by continuously reducing the global feature alignment loss value, so that the gap between the global feature of the source domain image sample and the global feature of the target domain image sample can improve the training efficiency of the model, the global feature alignment loss value is :
  • this application realizes that by performing regularization processing, global feature extraction processing, and classification recognition on the feature vector graph, the global domain classification result corresponding to the feature vector graph is obtained, and the feature regular loss value is obtained The loss value is aligned with the global feature. Therefore, the introduction of the feature regular loss value and the global feature alignment loss value can improve the robustness and accuracy of the domain adaptive model, and improve the training efficiency of the model.
  • S50 Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the source domain image sample corresponding
  • the category label obtains the detection loss value; and the total loss value is obtained according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value and the feature regular loss value.
  • the detection model only performs boundary regression and source domain classification and recognition on the area feature vector map corresponding to the source domain image sample, and the boundary regression is to locate the area feature corresponding to the source domain image sample
  • the target image area in the vector graph the target image area is the area that needs to be image recognized, that is, the target image area can reflect the category characteristics of the source domain image sample, and the source domain classification is recognized as
  • the image feature is extracted from the target image area in the area feature vector diagram corresponding to the source domain image sample, and the image feature also includes the image feature related to the category of the source domain image sample, and the process is performed based on the extracted image feature Predictive recognition, to identify the category of the source domain image sample, and the method of extracting image features related to the source domain image sample category can be set according to requirements, preferably the extraction method of the neural network model of VGG16, so as to obtain the recognition As a result, the recognition result characterizes the category contained in the source domain image sample, and the loss value between the recognition result and the category label corresponding to the
  • the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value are input into a total loss function, and the total loss is calculated by the total loss function Value;
  • the median loss value is:
  • ⁇ 1 is the weight of the global feature alignment loss value
  • L global is the global feature alignment loss value
  • ⁇ 2 is the weight of the local feature alignment loss value
  • L local is the local feature alignment loss value
  • ⁇ 3 is the weight of the detection loss value
  • L detection is the detection loss value
  • ⁇ 4 is the weight of the feature regular loss value
  • L norm is the feature regular loss value.
  • the convergence condition may be a condition that the value of the total loss value is small and will not drop after 50,000 calculations, that is, the value of the total loss value is small and will not decrease after 50,000 calculations.
  • the convergence condition can also be the condition that the total loss value is less than the set threshold, that is, When the total loss value is less than the set threshold, the training is stopped, and the domain adaptive model after convergence is recorded as the trained domain adaptive model.
  • the initial parameters of the iterative domain adaptive model can be continuously updated, and the data between the source domain image samples and the target domain image samples can be gradually reduced.
  • Distribution difference and then realize the transfer of the knowledge of the source domain image sample to learn the knowledge of the target domain image sample, use the existing source domain image sample knowledge to learn the knowledge of the target domain image sample through the algorithm, that is, find the source domain image sample
  • the similarity between the knowledge and the knowledge of the target domain image sample can realize the recognition of the target domain image sample based on the category of the source domain image sample, and make the recognition accuracy rate higher and higher.
  • this application realizes that by acquiring an image sample set containing multiple image samples; the image samples include source domain image samples and target domain image samples; inputting the image samples into a Faster-RCNN-based domain automaton containing initial parameters
  • An adaptive model is used to perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector map; and use the region extraction model to perform image feature extraction on the preprocessed image Perform region extraction and equalization sampling on the feature vector image to obtain a regional feature vector image; perform local feature extraction processing and binary classification recognition on the region feature vector image corresponding to the image sample through the local feature model to obtain local features Alignment loss value;
  • the feature vector graph is regularized and global feature recognition processing is performed through the global feature model to obtain the feature regularization loss value and the global feature alignment loss value; the detection model is used to compare with the source domain image
  • the regional feature vector map corresponding to the sample performs boundary regression and source
  • this application provides a domain adaptive model training
  • the method is to obtain image samples of the source and target domains for training, without artificial labeling of the image samples of the target domain, and adaptively adapt to the distribution differences of the image data of different domain sources through global feature alignment and local feature alignment.
  • the training efficiency of the domain adaptive model is improved, and the feature regular loss value is introduced, which improves the robustness and accuracy of the domain adaptive model.
  • the total loss value of loss value, detection loss value, local feature alignment loss value and feature regular loss value converges the domain adaptive model based on Faster-RCNN, realizes cross-domain image recognition, and improves the accuracy of image recognition And reliability, saving labor costs.
  • the image detection method provided by this application can be applied in the application environment as shown in Fig. 1, in which the client (computer equipment) communicates with the server through the network.
  • the client includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices.
  • the server can be implemented as an independent server or a server cluster composed of multiple servers.
  • an image detection method is provided, and the technical solution mainly includes the following steps S100-S200:
  • An image detection instruction is received, and an image of a target area to be detected is acquired.
  • the image of the target area to be detected is acquired on the same device as the image sample of the target area, and the image of the target area to be detected is the same device that needs to be identified and is the same as the device that collects the target area image sample
  • the image detection instruction is triggered when the image of the target area to be detected is recognized.
  • the trigger mode of the image detection instruction can be set according to requirements, for example, automatically after the image of the target area to be detected is collected Trigger, or by clicking the OK button after collecting the image of the target area to be detected.
  • the method of acquiring the image of the target area to be detected can also be set according to requirements. For example, it can be triggered by
  • the path of storing the image of the target area to be detected for acquisition may also be obtained in the image detection instruction of the image of the target area to be detected, and so on.
  • the image feature includes the image feature being the color in the image.
  • the image detection model is trained and completed by the above-mentioned domain adaptive model training method. According to the extracted The image feature outputs the source domain category result, the category of the source domain category result is the same as the full set of category labels, and the source domain category result represents the category of the target domain image to be detected.
  • this application realizes that by acquiring the image of the target domain to be detected; inputting the image of the target domain to be detected into the image detection model trained as the above-mentioned domain adaptive model training method, and extracting the target to be detected through the image detection model The image feature in the domain image is obtained, and the source domain category result output by the image detection model according to the image feature is obtained. Therefore, this application automatically recognizes the category of the target domain image to be detected through the domain adaptive model, realizing cross-device or Cross-domain image detection improves the accuracy and reliability of cross-domain recognition results and saves costs.
  • a domain adaptive model training device is provided, and the domain adaptive model training device corresponds to the domain adaptive model training method in the above-mentioned embodiment in a one-to-one correspondence.
  • the domain adaptive model training device includes an acquisition module 11, an input module 12, an extraction module 13, a first loss module 14, a second loss module 15 and a training module 16.
  • the detailed description of each functional module is as follows:
  • the obtaining module 11 is used to obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample, one category label, and one Domain label association; one of the target domain image samples is associated with one domain label;
  • the input module 12 is configured to input the image sample into a Faster-RCNN-based domain adaptation model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample;
  • the domain adaptation The model includes the preprocessing model, feature extraction model, region extraction model, detection model, global feature model, and local feature model;
  • the extraction module 13 is configured to perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector image
  • the first loss module 14 is configured to perform region extraction and equal sampling of the feature vector map through the region extraction model to obtain a region feature vector map; and use the local feature model to perform regional feature vectors corresponding to the image samples
  • the map performs local feature extraction processing and binary classification recognition to obtain a local domain classification result, and according to the local domain classification result and the domain label corresponding to the image sample, the local feature alignment loss value is obtained; at the same time, the global feature model is passed Perform regularization and global feature recognition processing on the feature vector graph to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment according to the global domain classification result and the domain label corresponding to the feature vector graph Loss value
  • the second loss module 15 is configured to perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model, to obtain the recognition result, and to obtain the recognition result according to the recognition result and the comparison with the
  • the category label corresponding to the source domain image sample obtains the detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value, a total loss value is obtained;
  • the training module 16 is configured to iteratively update the initial parameters of the domain adaptive model when the total loss value does not reach the preset convergence condition, until the total loss value reaches the preset convergence condition, The domain adaptive model after convergence is recorded as a trained domain adaptive model.
  • the input module 12 includes:
  • the matching sub-module is configured to perform size matching on the image sample through the preprocessing model according to preset size parameters to obtain a matching image sample;
  • the conversion sub-module is configured to perform denoising and image enhancement processing on the matched image samples through the preprocessing model according to the gamma transformation algorithm to obtain the preprocessed image samples.
  • the first loss module 14 includes:
  • An extraction sub-module configured to perform region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame;
  • the pooling sub-module is used to perform balanced sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
  • the first loss module 14 further includes:
  • the local extraction sub-module is used to perform local feature extraction on the regional feature vector map by the feature extractor in the local feature model to obtain a local feature vector map;
  • the local classification sub-module is used to perform two-class recognition on the local feature vector graph through the domain classifier in the local feature model to obtain the local domain classification result;
  • the local inversion sub-module is used to reverse and align the local domain classification results through the gradient inversion layer in the local feature model to obtain a reverse domain label;
  • the local loss sub-module is used to compare the difference between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference measurer in the local feature model to obtain the local feature alignment loss value.
  • the first loss module 14 further includes:
  • the global regularization sub-module is used to regularize the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature map, and at the same time, calculate all the features through the regular loss function in the feature regular model.
  • the regular loss value of the characteristic is used to regularize the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature map, and at the same time, calculate all the features through the regular loss function in the feature regular model.
  • a global classification sub-module configured to perform global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result;
  • the global loss sub-module is used to input the global domain classification result and the domain label corresponding to the feature vector graph into a global loss model, and calculate the global domain classification result and the feature by the global loss model The difference between the domain labels corresponding to the vector graph is used to obtain the global feature alignment loss value.
  • Each module in the above-mentioned domain adaptive model training device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • an image detection device is provided, and the image detection device corresponds to the image detection method in the above-mentioned embodiment one-to-one.
  • the image detection device includes a receiving module 101 and a detection module 102.
  • the detailed description of each functional module is as follows:
  • the receiving module 101 is configured to receive an image detection instruction and obtain an image of a target area to be detected;
  • the detection module 102 is configured to input the image of the target domain to be detected into the image detection model trained by the domain adaptive model training method according to any one of claims 1 to 5, and extract the image to be detected from the image detection model The image feature in the target domain image is obtained, and the source domain classification result output by the image detection model according to the image feature is obtained.
  • Each module in the above-mentioned image detection device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by the processor to implement a domain adaptive model training method or image detection method.
  • the readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor.
  • the processor executes the computer-readable instructions, the domains in the foregoing embodiments are implemented.
  • the adaptive model training method, or the processor executes the computer program to implement the image detection method in the above embodiment.
  • one or more readable storage media storing computer readable instructions are provided.
  • the readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage. Medium; the readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by one or more processors, the one or more processors implement the image detection method in the above-mentioned embodiments.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Abstract

A region-based self-adaptive model training method and device, an image detection method and device, an apparatus and a medium. The region-based self-adaptive model training method comprises: acquiring an image sample set containing a plurality of image samples; inputting the image samples into a region-based adaptive model that is based on Faster-RCNN and that contains initial parameters, performing image conversion on the image samples by means of a preprocessing model so as to obtain preprocessed image samples; obtaining a feature vector graph by means of a feature extraction model; obtaining a region feature vector graph by means of a region extraction model; obtaining a local feature alignment loss value by means of a local feature model; performing normalization and global feature recognition processing by means of a global feature model so as to obtain a feature normal loss value and a global feature alignment loss value; obtaining a detection loss value by means of a detection model; obtaining a total loss value; and iteratively updating the initial parameters until achieving convergence so as to obtain a trained region-based self-adaptive model. The present method allows for cross-region image recognition, improving image recognition accuracy and reliability.

Description

域自适应模型训练、图像检测方法、装置、设备及介质Domain adaptive model training, image detection method, device, equipment and medium
本申请要求于2020年7月28日提交中国专利局、申请号为202010737198.7,发明名称为“域自适应模型训练、图像检测方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on July 28, 2020, the application number is 202010737198.7, and the invention title is "domain adaptive model training, image detection methods, devices, equipment and media", all of which The content is incorporated in this application by reference.
技术领域Technical field
本申请涉及人工智能的分类模型领域,尤其涉及一种域自适应模型训练、图像检测方法、装置、计算机设备及存储介质。This application relates to the field of artificial intelligence classification models, and in particular to a domain adaptive model training, image detection methods, devices, computer equipment, and storage media.
背景技术Background technique
发明人发现目前深度学习方法已经在人工智能中得到广泛使用,但是,深度学习方法对训练数据分布的依赖性非常强。若采集的训练数据的分布存在差异,将会导致深度学习方法最终训练的模型的检测精确度低。比如,OCT(Optical coherence tomography)病变检测是医学诊断中非常重要的部分。研究人员已经开始基于深度学习通过OCT进行病灶检测,但是,由于不同的OCT采集设备的采集参数和采集方式存在差异,因此,采集的不同设备的数据之间的分布存在差异,将严重影响检测结果,导致检测结果存在偏差,进而使得检测准确率低。The inventor found that the current deep learning method has been widely used in artificial intelligence, but the deep learning method is very dependent on the distribution of training data. If the distribution of the collected training data is different, the detection accuracy of the model finally trained by the deep learning method will be low. For example, OCT (Optical Coherence Tomography) lesion detection is a very important part of medical diagnosis. Researchers have begun to detect lesions through OCT based on deep learning. However, due to the differences in the collection parameters and collection methods of different OCT collection devices, there are differences in the distribution of data collected by different devices, which will seriously affect the detection results , Resulting in deviations in the detection results, which in turn makes the detection accuracy rate low.
发明内容Summary of the invention
本申请提供一种域自适应模型训练、图像检测方法、装置、计算机设备及存储介质,实现了无需对目标域图像进行人工标签,通过对不同域源头的图像数据的分布差异进行自适应对齐,提高了域自适应模型的训练效率,以及引入特征正则损失值,提升了域自适应模型的鲁棒性和准确性,并且通过域自适应模型自动识别出目标域图像的类别,实现了跨域图像检测,提高了识别可靠性,及节省了成本。This application provides a domain adaptive model training, image detection method, device, computer equipment, and storage medium, which realizes that there is no need to manually label images in the target domain, and by adaptively aligning the distribution differences of image data from different domain sources, Improve the training efficiency of the domain adaptive model, and introduce the feature regular loss value, improve the robustness and accuracy of the domain adaptive model, and automatically identify the category of the target domain image through the domain adaptive model, realizing cross-domain Image detection improves the reliability of recognition and saves costs.
一种域自适应模型训练方法,包括:A domain adaptive model training method, including:
获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
一种图像检测方法,包括:An image detection method, including:
接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
一种域自适应模型训练装置,包括:A domain adaptive model training device, including:
获取模块,用于获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;The acquisition module is used to acquire an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample, one category label, and one domain Label association; one image sample of the target domain is associated with one domain label;
输入模块,用于将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The input module is used to input the image sample into a Faster-RCNN-based domain adaptive model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model Including the preprocessing model, feature extraction model, region extraction model, detection model, global feature model, and local feature model;
提取模块,用于通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;An extraction module, configured to perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector image;
第一损失模块,用于通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;The first loss module is used to perform region extraction and equal sampling of the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform region feature vector maps corresponding to the image samples Perform local feature extraction processing and binary classification recognition to obtain a local domain classification result, and obtain a local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the global feature model is used to The feature vector graph performs regularization and global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and according to the global domain classification result and the domain label corresponding to the feature vector graph, a global feature alignment loss is obtained value;
第二损失模块,用于通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;The second loss module is used to perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain the recognition result, and according to the recognition result and the source domain The category label corresponding to the domain image sample obtains the detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value, a total loss value is obtained;
训练模块,用于在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。The training module is configured to iteratively update the initial parameters of the domain adaptive model when the total loss value does not reach the preset convergence condition, until the total loss value reaches the preset convergence condition, it will converge The subsequent domain adaptive model is recorded as a trained domain adaptive model.
一种图像检测装置,包括:An image detection device includes:
接收模块,用于接收到图像检测指令,获取待检测目标域图像;The receiving module is used to receive the image detection instruction and obtain the image of the target area to be detected;
检测模块,用于将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The detection module is used to input the image of the target domain to be detected into the image detection model trained as the above-mentioned domain adaptive model training method, extract the image features in the image of the target domain to be detected through the image detection model, and obtain all the images of the target domain. The image detection model outputs a source domain category result according to the image feature.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and balanced sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时还实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor further implements the following steps when the processor executes the computer-readable instructions:
接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target domain to be detected is input into the image detection model trained as the above-mentioned domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is obtained according to The source domain category result of the image feature output.
本申请提供的域自适应模型训练方法、装置、计算机设备及存储介质,通过获取含有多个图像样本的图像样本集;所述图像样本包括源域图像样本和目标域图像样本;将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局特征对齐损失值;通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;在所述总损失值未达到预设的收敛条件时,迭代更新初始参数直至收敛,得到训练完成的域自适应模型,因此,本申请提供了一种域自适应模型训练方法,通过获取源域和目标域的图像样本进行训练,无需对目标域的图像样本进行人工标签,通过全局特征对齐和局部特征对齐的方式对不同域源头的图像数据的分布差异进行自适应,提高了域自适应模型的训练效率,并引入特征正则损失值,提升了域自适应模型的鲁棒性和准确性,如此,实现了通过不同域的图像样本进行训练,并根据含有全局特征对齐损失值、检测损失值、局部特征对齐损失值和特征正则损失值的总损失值,对基于Faster-RCNN的域自适应模型进行收敛,实现了跨域的图像识别,提高了图像识别的准确性和可靠性,节省了人工成本。The domain adaptive model training method, device, computer equipment, and storage medium provided in this application obtain an image sample set containing multiple image samples; the image samples include source domain image samples and target domain image samples; The sample input contains initial parameters and is based on a Faster-RCNN-based domain adaptive model. The image sample is image converted by the preprocessing model to obtain the preprocessed image sample; the preprocessed image is imaged by the feature extraction model Extract and obtain a feature vector map; perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform a regional feature vector map corresponding to the image sample Perform local feature extraction processing and binary classification recognition to obtain local feature alignment loss values; at the same time, perform regularization and global feature recognition processing on the feature vector graph through the global feature model to obtain feature regularization loss values and global feature alignment loss values Perform boundary regression and source domain classification and recognition on the regional feature vector map corresponding to the source domain image sample through the detection model to obtain the detection loss value; according to the global feature alignment loss value, the detection loss value, and the The local feature alignment loss value and the feature regular loss value are used to obtain the total loss value; when the total loss value does not reach the preset convergence condition, the initial parameters are iteratively updated until convergence, and the trained domain adaptive model is obtained, Therefore, this application provides a domain adaptive model training method, which is trained by acquiring image samples of the source domain and the target domain, without artificial labeling of the image samples of the target domain, and the method of global feature alignment and local feature alignment The distribution differences of image data from different domain sources are adapted to improve the training efficiency of the domain adaptive model, and the feature regular loss value is introduced to improve the robustness and accuracy of the domain adaptive model. The image samples of the domain are trained, and the domain adaptive model based on Faster-RCNN is converged according to the total loss value containing the global feature alignment loss value, detection loss value, local feature alignment loss value and feature regular loss value. Cross-domain image recognition improves the accuracy and reliability of image recognition and saves labor costs.
本申请提供的图像检测方法、装置、计算机设备及存储介质,接收到图像检测指令,通过获取待检测目标域图像;将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果,如此,本申请通过域自适应模型自动识别出目标域图像的类别,实现了跨域图像检测,提高了识别可靠性,及节省了成本。The image detection method, device, computer equipment and storage medium provided in this application receive the image detection instruction and obtain the image of the target domain to be detected; input the image of the target domain to be detected into the training completed by the above-mentioned domain adaptive model training method The image detection model extracts the image features in the image of the target domain to be detected through the image detection model, and obtains the source domain category results output by the image detection model according to the image features. In this way, this application adopts the domain adaptive model The category of the target domain image is automatically recognized, cross-domain image detection is realized, the recognition reliability is improved, and the cost is saved.
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。The details of one or more embodiments of the present application are presented in the following drawings and description, and other features and advantages of the present application will become apparent from the description, drawings and claims.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
图1是本申请一实施例中域自适应模型训练方法或图像检测方法的应用环境示意图;FIG. 1 is a schematic diagram of an application environment of a domain adaptive model training method or an image detection method in an embodiment of the present application;
图2是本申请一实施例中域自适应模型训练方法的流程图;FIG. 2 is a flowchart of a method for training a domain adaptive model in an embodiment of the present application;
图3是本申请一实施例中域自适应模型训练方法的步骤S20的流程图;FIG. 3 is a flowchart of step S20 of a domain adaptive model training method in an embodiment of the present application;
图4是本申请一实施例中域自适应模型训练方法的步骤S40的流程图;4 is a flowchart of step S40 of the method for training a domain adaptive model in an embodiment of the present application;
图5是本申请另一实施例中域自适应模型训练方法的步骤S40的流程图;FIG. 5 is a flowchart of step S40 of a method for training a domain adaptive model in another embodiment of the present application;
图6是本申请又一实施例中域自适应模型训练方法的步骤S40的流程图;FIG. 6 is a flowchart of step S40 of the domain adaptive model training method in another embodiment of the present application;
图7是本申请一实施例中图像检测方法的流程图;Fig. 7 is a flowchart of an image detection method in an embodiment of the present application;
图8是本申请一实施例中域自适应模型训练装置的原理框图;Fig. 8 is a functional block diagram of a domain adaptive model training device in an embodiment of the present application;
图9是本申请一实施例中图像检测装置的原理框图;Fig. 9 is a functional block diagram of an image detection device in an embodiment of the present application;
图10是本申请一实施例中计算机设备的示意图。Fig. 10 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请提供的域自适应模型训练方法,可应用在如图1的应用环境中,其中,客户端(计算机设备)通过网络与服务器进行通信。其中,客户端(计算机设备)包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑、摄像头和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The domain adaptive model training method provided by this application can be applied in an application environment as shown in Fig. 1, where a client (computer device) communicates with a server through a network. Among them, the client (computer equipment) includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices. The server can be implemented as an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,提供一种域自适应模型训练方法,其技术方案主要包括以下步骤S10-S60:In an embodiment, as shown in FIG. 2, a method for training a domain adaptive model is provided, and its technical solution mainly includes the following steps S10-S60:
S10,获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联。S10. Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; An image sample of the target domain is associated with a domain label.
可理解地,接收到域自适应模型的训练请求,触发获取用于训练域自适应模型的所述图像样本集,所述图像样本集为收集的所述图像样本的集合,所述图像样本包含有所述源域图像样本和所述目标域图像样本,所述源域图像样本为在一已知领域或者通过一已知设备进行采集且标注有类别标签的图像,所述类别标签表明了所述源域图像样本的类别,比如,在一已知的OCT采集设备上采集了OCT图像样本,并且该OCT图像样本已经标注有该OCT图像样本中含有的区域的类别标签(脉络膜区域、黄斑裂孔区域等等),一个所述源域图像样本与一个类别标签及一个域标签关联,所述域标签作为所述源域图像样本和所述目标域图像样本的区分标识,所述域标签包括源域标签和目标域标签,比如与标签包含一已知设备对应的型号标签(源域标签)和另一与该已知设备相似的设备对应的型号标签(目标域标签),所述源域图像样本与所述源域标签关联,所述目标域图像样本与所述目标域标签关联,一个所述目标域图像样本与一个域标签关联,所述目标域图像样本为在一与该已知领域相关的领域或者通过另一与该已知设备相似的设备进行采集且未标注有类别标签的图像。Understandably, receiving a training request for a domain adaptive model triggers the acquisition of the image sample set used to train the domain adaptive model, the image sample set being a collection of the collected image samples, and the image samples include There are the source domain image sample and the target domain image sample, the source domain image sample is an image collected in a known field or by a known device and marked with a category label, and the category label indicates all The category of the source domain image sample, for example, an OCT image sample is collected on a known OCT acquisition device, and the OCT image sample has been marked with the category label of the area contained in the OCT image sample (choroidal area, macular hole) Region, etc.), one of the source domain image samples is associated with a category label and a domain label, the domain label serves as a distinguishing identifier between the source domain image sample and the target domain image sample, and the domain label includes the source The domain label and the target domain label, for example, the label includes a model label (source domain label) corresponding to a known device and a model label (target domain label) corresponding to another device similar to the known device, the source domain image The sample is associated with the source domain label, the target domain image sample is associated with the target domain label, one target domain image sample is associated with one domain label, and the target domain image sample is associated with the known domain Related fields or images that are collected by another device similar to the known device and are not marked with a category label.
S20,将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型。S20. Input the image sample into a Faster-RCNN-based domain adaptive model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the Preprocessing model, feature extraction model, region extraction model, detection model, global feature model and local feature model.
可理解地,所述域自适应模型为基于Faster-RCNN进行图像目标检测的神经网络模型,所述域自适应模型包含所述初始参数,所述初始参数包括域自适应模型的网络结构和个模型的参数,所述域自适应模型的网络结构包括Faster-RCNN的网络结构,所述预处理模型为对输入的所述图像样本进行图像转换,转换成所述预处理图像样本,所述图像转换为对图像进行尺寸参数和像素增强的图像处理过程,该过程可以根据需求设定,比如图像转换包括对输入的图像进行缩放成预设的尺寸参数的图像,对缩放后的图像进行图像增强,并对转换后的图像样本进行像素增强的操作,所述域自适应模型包括预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型。Understandably, the domain adaptive model is a neural network model based on Faster-RCNN for image target detection, the domain adaptive model includes the initial parameters, and the initial parameters include the network structure and individual parameters of the domain adaptive model. The parameters of the model, the network structure of the domain adaptive model includes the network structure of Faster-RCNN, the preprocessing model is to perform image conversion on the input image sample to convert the preprocessed image sample, the image The conversion is an image processing process that performs size parameter and pixel enhancement on the image. The process can be set according to requirements. For example, image conversion includes scaling the input image into an image with preset size parameters, and performing image enhancement on the scaled image , And perform pixel enhancement operations on the converted image samples. The domain adaptive model includes a preprocessing model, a feature extraction model, a region extraction model, a detection model, a global feature model, and a local feature model.
在一实施例中,如图3所示,所述步骤S20中,即所述通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本,包括:In one embodiment, as shown in FIG. 3, in the step S20, that is, the image conversion is performed on the image sample through the preprocessing model to obtain the preprocessed image sample, including:
S201,根据预设的尺寸参数,通过所述预处理模型对所述图像样本进行尺寸匹配,得 到匹配图像样本。S201: Perform size matching on the image sample through the preprocessing model according to a preset size parameter to obtain a matching image sample.
可理解地,所述图像样本的尺寸大小根据采集设备的不同而不同,需要通过所述预处理模型对所述图像样本进行图像转换,得到统一格式的图像,所述尺寸参数根据需求设定,所述尺寸参数包括图像的长、宽、通道数,所述通道数为将所述图像样本转换后的通道数量,所述预处理模型根据所述尺寸参数,将所述图像样本转换成所述匹配图像样本,所述尺寸匹配为将所述图像样本进行缩放处理、合并处理或者缩放及合并处理,以达到所述尺寸参数的要求的图像,例如图像样本的尺寸为三个通道的600×800的图像,尺寸参数为(600×600,3),则经过尺寸匹配处理后得到的匹配图像样本的尺寸为三个通道的600×600的图像。Understandably, the size of the image sample varies according to different collection devices, and the image sample needs to be image converted through the preprocessing model to obtain an image in a unified format, and the size parameters are set according to requirements, The size parameter includes the length, width, and number of channels of the image, the number of channels is the number of channels after the image sample is converted, and the preprocessing model converts the image sample into the Matching an image sample, the size matching is an image that performs scaling processing, merging processing, or scaling and merging processing on the image sample to meet the requirements of the size parameter, for example, the size of the image sample is 600×800 with three channels The size parameter of the image is (600×600, 3), then the size of the matched image sample obtained after the size matching process is a 600×600 image with three channels.
S202,根据伽马变换算法,通过所述预处理模型对所述匹配图像样本进行去噪及图像增强处理,得到所述预处理图像样本。S202: Perform denoising and image enhancement processing on the matched image sample through the preprocessing model according to the gamma transformation algorithm to obtain the preprocessed image sample.
可理解地,所述预处理模型对所述匹配图像样本进行减少图像噪声,所述去噪处理可以根据需求设定,比如去噪处理可以为中值滤波去噪、高斯滤波去噪、均值滤波去噪、维纳滤波去噪或者傅里叶滤波去噪等等,通过所述预处理模型对去噪后的所述匹配图像样本进行图像增强处理,最终得到所述预处理图像样本,所述图像增强处理为运用所述伽马变换算法对去噪后的所述匹配图像样本中的每个像素进行增强的处理操作,所述伽马变换算法为对图像进行校正,将图像中灰度过高或者灰度过低的图片进行修正,增强对比度的算法。Understandably, the preprocessing model reduces image noise on the matched image samples, and the denoising processing can be set according to requirements. For example, the denoising processing can be median filtering denoising, Gaussian filtering denoising, and mean filtering. Denoising, Wiener filtering denoising or Fourier filtering denoising, etc., through the preprocessing model, perform image enhancement processing on the matched image samples after denoising, and finally obtain the preprocessed image samples. The image enhancement processing is the processing operation of using the gamma transformation algorithm to enhance each pixel in the matched image sample after denoising. The gamma transformation algorithm is to correct the image and transform the gray scale of the image. An algorithm for correcting images with high or low gray levels to enhance contrast.
S30,通过所述特征提取模型对所述预处理图像进行图像特征提取,得到特征向量图。S30: Perform image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram.
可理解地,对所述预处理图像提取所述图像特征,所述图像特征为图像中的颜色特征、纹理特征、形状特征和空间关系特征,所述特征提取模型包括Faster-RCNN的网络结构中的13个卷积层、13个激活层和4个池化层,通过所述预处理图像输入所述特征提取模型,并经过各卷积层、各激活层和各池化层的所述图像特征的提取,得到所述特征向量图,所述特征向量图为多通道(也为多维度)且含有所述图像特征的向量的矩阵。Understandably, the image features are extracted from the preprocessed image, the image features are color features, texture features, shape features, and spatial relationship features in the image, and the feature extraction model includes the network structure of Faster-RCNN The 13 convolutional layers, 13 activation layers, and 4 pooling layers of, input the feature extraction model through the pre-processed image, and pass the image of each convolution layer, each activation layer, and each pooling layer The feature is extracted to obtain the feature vector graph, which is a matrix of multi-channel (also multi-dimensional) and containing vectors of the image features.
S40,通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值。S40: Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; perform local feature extraction processing on the region feature vector map corresponding to the image sample through the local feature model And two-class recognition to obtain a local domain classification result, and obtain a local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the global feature model is used to compare the feature vector map Perform regularization and global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph.
可理解地,所述区域提取模型也称区域生成网络(RPN,Region Proposal Network),所述区域提取模型对所述特征向量图进行区域提取和均衡采样处理,所述区域提取为从所述特征向量图中提取出多个候选区域框,所述候选区域框为含有符合预设要求的锚(Anchor)的目标区域(也为感兴趣的目标区域),所述均衡采样为对所有所述候选区域框映射至所述特征向量图中,并将所述候选区域框映射至所述特征向量图中的区域进行感兴趣区域池化(ROI Pooling)处理,得到相同大小的所述区域特征向量图,所述均衡采样的目的是将不同大小的候选区域框池化成相同大小区域特征向量图。Understandably, the region extraction model is also called a region generation network (RPN, Region Proposal Network). The region extraction model performs region extraction and equalization sampling processing on the feature vector graph, and the region extraction is derived from the features A plurality of candidate area frames are extracted from the vector graph. The candidate area frame is a target area (also a target area of interest) that contains an anchor that meets the preset requirements, and the equalized sampling is performed for all the candidates The region box is mapped to the feature vector map, and the candidate region box is mapped to the region in the feature vector map to perform ROI Pooling processing to obtain the region feature vector map of the same size The purpose of the balanced sampling is to pool candidate regions of different sizes into the same size region feature vector map.
其中,所述局部特征模型提取所述区域特征向量图中的局部特征,所述局部特征提取处理为提取出局部区域中所隐藏的信息中相同性质的特征,比如边缘的点或线等,得到多个局部特征向量图,再通过所述局部特征模型对所有局部特征向量图进行二分类识别,即通过二分类法识别所述局部特征向量图为源域标签结果还是目标域标签结果,所述局部域分类结果包括局部源域标签结果和局部目标域标签结果,而且所述局部域分类结果还包括识别出与局部源域标签结果对应的概率值和与局部目标域标签结果对应的概率值,根据所述局部域分类结果和与所述局部域分类结果对应的输入的所述图像样本对应的域标签进行计算,得到局部特征对齐损失值,通过所述局部特征对齐损失值进行反向传播,调整所 述局部特征模型中的参数,通过所述局部特征对齐损失值不断将源域图像样本中的局部特征和目标域图像样本中的局部特征之间互相对齐,缩小局部特征之间的差异,即通过从源域图像样本的中的局部特征中提取用于对目标域图像样本进行二分类识别且有效的局部特征,从目标域图像样本中的局部特征中提取用于源域图像样本进行二分类识别且有效的局部特征。Wherein, the local feature model extracts local features in the region feature vector graph, and the local feature extraction process is to extract features of the same nature in the information hidden in the local region, such as edge points or lines, to obtain A plurality of local feature vector graphs, and then perform binary classification recognition on all the local feature vector graphs through the local feature model, that is, to identify whether the local feature vector graph is the source domain label result or the target domain label result through the binary classification method, the The local domain classification result includes a local source domain label result and a local target domain label result, and the local domain classification result also includes identifying a probability value corresponding to the local source domain label result and a probability value corresponding to the local target domain label result, Calculate according to the local domain classification result and the domain label corresponding to the input image sample corresponding to the local domain classification result to obtain a local feature alignment loss value, and perform back propagation through the local feature alignment loss value, Adjust the parameters in the local feature model, and continuously align the local features in the source domain image sample and the local feature in the target domain image sample through the local feature alignment loss value to reduce the difference between the local features, That is, by extracting from the local features in the source domain image samples the effective local features for the two-class recognition of the target domain image samples, and extracting the source domain image samples from the local features in the target domain image samples. Classification and recognition of effective local features.
其中,所述全局特征模型对所述特征向量图进行正则化处理,并对正则化后的所述特征向量图进行全局特征识别处理,所述全局特征识别处理为对正则化后的所述特征向量图进行全局特征提取,根据提取的所述全局特征对正则化后的所述特征向量图进行分类识别,所述分类识别为二分类法识别,得到所述全局域分类结果,根据正则化后的所述特征向量图,得到特征正则损失值,所述特征正则损失值能够对提取的所述全局特征进行最小化损失处理,防止过拟合,所述全局域分类结果包括全局源域标签结果和全局目标域标签结果,所述全局域分类结果还包括识别出与全局域标签结果对应的概率值和与全局目标域标签结果对应的概率值,根据所述全局域分类结果和与所述特征向量图对应的域标签的差距,得到全局特征对齐损失值,通过所述全局特征对齐损失值进行反向传播,调整所述全局特征模型中的参数,通过所述全局特征对齐损失值不断将源域图像样本中的全局特征和目标域图像样本中的全局特征之间互相对齐,缩小全局特征之间的差异,即通过从源域图像样本的中的全局特征中提取用于对目标域图像样本进行二分类识别且有效的全局特征,从目标域图像样本中的全局特征中提取用于源域图像样本进行分类识别且有效的全局特征,所述全局特征为在正则化后的特征向量图中体现的颜色特征、纹理特征和形状特征等能代表整体物体的相关特征。Wherein, the global feature model performs a regularization process on the feature vector graph, and performs a global feature recognition process on the regularized feature vector graph, and the global feature recognition process is the regularized feature Perform global feature extraction on the vector graph, classify and recognize the regularized feature vector graph according to the extracted global feature, the classification recognition is binary classification recognition, and obtain the global domain classification result, according to the regularization The feature vector graph of, obtains the feature regular loss value, the feature regular loss value can minimize the loss processing on the extracted global feature to prevent overfitting, and the global domain classification result includes the global source domain label result And the global target domain label result, the global domain classification result further includes identifying the probability value corresponding to the global domain label result and the probability value corresponding to the global target domain label result, according to the global domain classification result and the feature The gap between the domain labels corresponding to the vector graph is used to obtain the global feature alignment loss value. The global feature alignment loss value is used for backpropagation, the parameters in the global feature model are adjusted, and the global feature alignment loss value is continuously updated. The global features in the image samples of the source domain and the global features in the target domain image samples are aligned with each other to reduce the difference between the global features. That is, by extracting the global features from the source domain image samples, it is used to compare the target domain image samples. Perform two-class recognition and effective global features, extract from the global features in the target domain image samples the effective global features for the source domain image samples for classification and recognition, the global features are in the regularized feature vector image The embodied color feature, texture feature, and shape feature can represent the relevant features of the overall object.
在一实施例中,如图4所示,所述步骤S40中,即所述所述通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图,包括:In an embodiment, as shown in FIG. 4, the step S40, that is, the performing region extraction and equalization sampling on the feature vector map through the region extraction model to obtain a region feature vector map includes:
S401,通过所述区域提取模型中的区域提取网络层对所述特征向量图进行区域提取,得到至少一个候选区域框。S401: Perform region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame.
可理解地,所述区域提取模型包括区域提取网络层和感兴趣区域池化层,所述区域提取网络层包括一个3×3的卷积层、一个激活层、两个不同维度参数的1×1的卷积层、一个softmax层和全连接层,所述区域提取为将所述特征向量图通过3×3的卷积层的卷积得到第一特征图,将所述第一特征图分别输入第一1×1的卷积层和第二1×1的卷积层,分别得到不同维度的第二特征图和第三特征图,通过所述softmax层对第二特征图进行锚(Anchor)的生成,通过所述全连接层对所述第三特征图和经过所述softmax层后的所述第二特征图进行分类处理并通过边框回归(bbox regression)进行锁定,最后输出至少一个所述候选区域框。Understandably, the region extraction model includes a region extraction network layer and a region of interest pooling layer, and the region extraction network layer includes a 3×3 convolution layer, an activation layer, and two 1×3 layers with different dimensional parameters. 1 convolutional layer, a softmax layer, and a fully connected layer, the region is extracted as the first feature map obtained by convolution of the feature vector map through a 3×3 convolutional layer, and the first feature map is respectively Input the first 1×1 convolutional layer and the second 1×1 convolutional layer to obtain the second feature map and the third feature map of different dimensions, and the second feature map is anchored through the softmax layer. ), the third feature map and the second feature map after passing through the softmax layer are classified through the fully connected layer, and locked through bbox regression, and finally at least one feature map is output The candidate area frame.
S402,通过所述区域提取模型中的感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图。S402: Perform equal sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
可理解地,所述感兴趣区域池层也称为ROI pooling,所述感兴趣区域池层将所有所述候选区域框映射到所述特征向量图中的与所述候选区域框中的目标对应的位置,即从所述特征向量图中查询到与所述候选区域框的各向量值相同的区域位置,将映射后的所述特征向量图中与所述候选区域框对应的区域进行预设的固定大小的池化处理,将与各所述候选区域框对应的区域能够池化得到相同大小的所述区域特征向量图,如此,能够得到与各所述候选区域框对应的相同大小的所述区域特征向量图。Understandably, the region of interest pooling layer is also called ROI pooling, and the region of interest pooling layer maps all the candidate region boxes to the target in the feature vector diagram corresponding to the target in the candidate region box The position of, that is, the region position that is the same as the vector value of the candidate region frame is queried from the feature vector map, and the region corresponding to the candidate region frame in the mapped feature vector map is preset The fixed-size pooling process can pool the regions corresponding to each of the candidate region frames to obtain the region feature vector map of the same size. In this way, it is possible to obtain all the regions of the same size corresponding to each candidate region frame. The area feature vector diagram.
本申请实现了通过区域提取网络层对所述特征向量图进行区域提取,得到候选区域框;通过感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图,如此,实现了通过区域提取网络层和感兴趣区域池层能够从所述特征向量图中自动识别出感兴趣的或有用的区域,并转换成便于后续特征提取的且相同大小的区域特征向量图,提高了识别效率和准确率,避免了不感兴趣或无用的区域对特征提取的干扰。This application realizes the area extraction of the feature vector graph through the area extraction network layer to obtain the candidate area frame; the area of interest pool layer is used to perform equal sampling processing on the feature vector graph and all the candidate area frames to obtain the area The feature vector map, in this way, realizes that the region extraction network layer and the region of interest pool layer can automatically identify interesting or useful regions from the feature vector map, and convert them into the same size that is convenient for subsequent feature extraction The regional feature vector map improves the recognition efficiency and accuracy, and avoids the interference of uninteresting or useless regions on feature extraction.
在一实施例中,如图5所示,所述步骤S40中,即所述通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值,包括:In one embodiment, as shown in FIG. 5, in the step S40, the local feature extraction process and the two-class recognition are performed on the regional feature vector map corresponding to the image sample through the local feature model to obtain The local domain classification result, and the local feature alignment loss value obtained according to the local domain classification result and the domain label corresponding to the image sample, including:
S403,通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图。S403: Perform local feature extraction on the regional feature vector map by using a feature extractor in the local feature model to obtain a local feature vector map.
可理解地,所述局部特征模型包括特征提取器、域分类器、梯度反转层和域差异度量器,所述特征提取器为各所述区域特征向量图进行所述局部特征提取,提取方法可以根据需求设定,比如SIFT(Scale Invariant Feature Transform)法、SURF(Speeded Up Robust Features)法、Harris Corner法和LBP(Local Binary Pattern,局部二值模式)法,作为优选,所述局部特征的提取方法为LBP法,因为LBP法具有旋转不变性和灰度不变性的特点,能够更有效的提取所述局部特征,经过所述特征提取器处理后,得到多个所述局部特征向量图。Understandably, the local feature model includes a feature extractor, a domain classifier, a gradient reversal layer, and a domain difference measurer. The feature extractor performs the local feature extraction for each of the regional feature vector graphs, and the extraction method It can be set according to requirements, such as SIFT (Scale Invariant Feature Transform) method, SURF (Speeded Up Robust Features) method, Harris Corner method, and LBP (Local Binary Pattern) method. Preferably, the local feature The extraction method is the LBP method. Because the LBP method has the characteristics of rotation invariance and gray level invariance, it can extract the local features more effectively, and after processing by the feature extractor, multiple local feature vector images are obtained.
S404,通过所述局部特征模型中的域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果。S404: Perform two-class recognition on the local feature vector graph by using a domain classifier in the local feature model to obtain the local domain classification result.
可理解地,所述域分类器的目标是最大化域分类器的损失,混淆目标域图像样本与源域图像样本的域标签识别结果,让与源域图像样本对应的所述局部特征向量图经过所述域分类器的二分类识别输出为局部目标域标签结果,如此能够让所述局部特征相互对齐。Understandably, the goal of the domain classifier is to maximize the loss of the domain classifier, confuse the domain label recognition results of the target domain image sample and the source domain image sample, and let the local feature vector map corresponding to the source domain image sample The two-class recognition output of the domain classifier is a local target domain label result, so that the local features can be aligned with each other.
S405,通过所述局部特征模型中的梯度反转层对所述局部域分类结果进行取反对齐,得到反向域标签。S405: Perform reverse alignment on the local domain classification result through the gradient reversal layer in the local feature model to obtain a reverse domain label.
可理解地,所述梯度反转层也称为GRL(Gradient Reversal Layer)层,所述取反对齐为在反向传播过程中梯度方向自动取反,在前向传播过程中不做处理,在进行反向传播计算局部特征对齐损失值之前时,通过所述梯度反转层将所述局部域分类结果自动取反,得到与所述局部域分类结果相反的所述反向域标签。Understandably, the gradient reversal layer is also referred to as a GRL (Gradient Reversal Layer) layer. The reverse alignment means that the gradient direction is automatically reversed during the backward propagation process, and no processing is performed during the forward propagation process. Before performing back propagation to calculate the local feature alignment loss value, the local domain classification result is automatically inverted through the gradient reversal layer to obtain the reverse domain label opposite to the local domain classification result.
S406,通过所述局部特征模型中的域差异度量器所述反向域标签和与所述区域特征向量图对应的域标签进行差异对比,得到所述局部特征对齐损失值。S406: Perform a difference comparison between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference metric in the local feature model to obtain the local feature alignment loss value.
可理解地,所述域差异度量器包含有所述局部特征对齐损失函数,所述差异对比为经过所述局部特征对齐损失函数计算获得的损失值,将所述反向域标签和与所述区域特征向量图对应的域标签输入所述局部特征对齐损失函数,得到所述局部特征对齐损失值,所述局部特征对齐损失值为:Understandably, the domain difference metric includes the local feature alignment loss function, and the difference comparison is a loss value obtained through calculation of the local feature alignment loss function, and the reverse domain label and the The domain label corresponding to the regional feature vector graph is input into the local feature alignment loss function to obtain the local feature alignment loss value, and the local feature alignment loss value is:
Figure PCTCN2020116742-appb-000001
Figure PCTCN2020116742-appb-000001
其中,n为所述图像样本集中的所述图像样本的总数量;m为与相同的所述图像样本对应的所述区域特征向量图的总数量;D i为在所述图像样本集中的第i个所述图像样本关联的域标签(例如:D i=0表示源域标签,D i=1表示目标域标签);p i,j为对与相同的第i个所述图像样本对应的第j个所述区域特征向量图对应的反向域标签。 Wherein, n is the total number of the image samples in the image sample set; m is the total number of the regional feature vector maps corresponding to the same image sample; D i is the first image sample in the image sample set The domain labels associated with the i image samples (for example, D i =0 indicates the source domain label, and D i =1 indicates the target domain label); p i,j is the pair corresponding to the same i-th image sample The reverse domain label corresponding to the j-th regional feature vector graph.
本申请实现了通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图;通过所述域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果;通过所述梯度反转层对所述局部域分类结果进行取反对齐,得到反向域标签;通过所述域差异度量器中的所述局部特征对齐损失函数,计算所述反向域标签和与所述区域特征向量图对应的域标签的损失,得到所述局部特征对齐损失值,如此,实现了自动对齐源域图像样本的局部特征和目标域图像样本的所述局部特征,能够有效的提取有用的局部特征进行对源域图像样本和目标域图像样本的识别,并通过局部特 征对齐损失值体现源域图像样本的局部特征和目标域图像样本的局部特征之间的差距,迭代所述初始参数的过程中不断缩小局部特征对齐损失值,能够提高模型的训练效率,提高了识别准确性和可靠性。The present application realizes the local feature extraction of the regional feature vector graph by the feature extractor in the local feature model to obtain the local feature vector graph; the two-class recognition of the local feature vector graph by the domain classifier , Obtain the local domain classification result; perform inverse alignment on the local domain classification result through the gradient reversal layer to obtain a reverse domain label; align the loss function through the local feature in the domain difference measurer Calculate the loss of the reverse domain label and the domain label corresponding to the regional feature vector graph to obtain the local feature alignment loss value. In this way, the local feature of the source domain image sample and the target domain image sample are automatically aligned The said local features can effectively extract useful local features to identify the source domain image samples and target domain image samples, and reflect the local features of the source domain image samples and the target domain image samples through the local feature alignment loss value The gap between the features, the local feature alignment loss value is continuously reduced in the process of iterating the initial parameters, which can improve the training efficiency of the model and improve the recognition accuracy and reliability.
在一实施例中,如图6所示,所述步骤S40中,即所述通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值,包括:In an embodiment, as shown in FIG. 6, in the step S40, the feature vector graph is regularized and the global feature recognition process is performed on the feature vector graph through the global feature model to obtain the feature regularization loss value and the global domain. The classification result, and according to the global domain classification result and the domain label corresponding to the feature vector graph, the global feature alignment loss value is obtained, including:
S407,通过所述全局特征模型中的特征正则模型对所述特征向量图进行正则化处理,得到全局正则特征图,同时通过所述特征正则模型中的正则损失函数计算出所述特征正则损失值。S407: Perform regularization processing on the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature map, and at the same time calculate the feature regular loss value through the regular loss function in the feature regular model .
可理解地,所述特征正则模型对各所述特征向量图进行正则化处理,所述正则化处理为对所述特征向量图中的各像素对应的特征向量进行平方求和然后对整体进行开方的处理操作,最终得到与所述特征向量图一一对应的所述全局正则特征图,如此,能够让各所述特征向量图中的各像素对应的特征向量变成很小,接近于零,缩小了各像素之间差异,防止过拟合,并且通过所述正则损失函数计算出所述特征正则损失值,引入特征正则损失值,提升了域自适应模型的鲁棒性和准确性,所述特征正则损失值为:Understandably, the feature regular model performs regularization processing on each of the feature vector graphs, and the regularization processing is to square and sum the feature vectors corresponding to each pixel in the feature vector graph, and then open the whole. The processing operation of the square finally obtains the global regular feature map one-to-one corresponding to the feature vector map. In this way, the feature vector corresponding to each pixel in each feature vector map can be made small, close to zero. , Reduce the difference between pixels, prevent over-fitting, and calculate the feature regular loss value through the regular loss function, introduce the feature regular loss value, and improve the robustness and accuracy of the domain adaptive model, The characteristic regular loss value is:
Figure PCTCN2020116742-appb-000002
Figure PCTCN2020116742-appb-000002
其中,n为所述图像样本集中的所述图像样本的总数量;E i为与第i个所述图像样本对应的所述全局正则特征图(0≤i≤n);R为预设的距离常数。 Wherein, n is the total number of the image samples in the image sample set; E i is the global canonical feature map corresponding to the i-th image sample (0≤i≤n); R is a preset Distance constant.
S408,通过所述全局特征模型对所述全局正则特征图进行全局特征提取处理和分类识别,得到所述全局域分类结果。S408: Perform global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result.
可理解地,所述全局特征提取处理为对所述全局正则特征图中的各像素对应的特征向量进行直方图特征提取,根据提取的所述全局特征进行分类识别,所述分类识别为二分类法识别,即识别结果只有两种分类结果,所述全局域分类结果包括全局源域标签结果和全局目标域标签结果,所述全局域分类结果还包括识别出与全局域标签结果对应的概率值和与全局目标域标签结果对应的概率值。Understandably, the global feature extraction process is to perform histogram feature extraction on the feature vector corresponding to each pixel in the global regular feature map, and perform classification recognition based on the extracted global feature, and the classification recognition is a two-category Method recognition, that is, the recognition result has only two classification results, the global domain classification result includes the global source domain label result and the global target domain label result, and the global domain classification result also includes the probability value corresponding to the global domain label result. And the probability value corresponding to the global target domain label result.
S409,将所述全局域分类结果和与所述特征向量图对应的域标签输入全局损失模型中,通过所述全局损失模型计算出所述全局域分类结果和与所述特征向量图对应的域标签之间的差异,得出所述全局特征对齐损失值。S409. Input the global domain classification result and the domain label corresponding to the feature vector graph into a global loss model, and calculate the global domain classification result and the domain corresponding to the feature vector graph through the global loss model The difference between the labels is used to obtain the global feature alignment loss value.
可理解地,所述全局损失模型包含有全局特征对齐损失函数,通过将所述全局域分类结果和与所述特征向量图对应的域标签输入所述全局特征对齐损失函数,计算得到所述全局特征对齐损失值,通过不断缩小全局特征对齐损失值,让源域图像样本的全局特征和目标域图像样本的全局特征之间的差距,能够提高模型的训练效率,所述全局特征对齐损失值为:Understandably, the global loss model includes a global feature alignment loss function, and the global feature alignment loss function is calculated by inputting the global domain classification result and the domain label corresponding to the feature vector graph into the global feature alignment loss function. The feature alignment loss value, by continuously reducing the global feature alignment loss value, so that the gap between the global feature of the source domain image sample and the global feature of the target domain image sample can improve the training efficiency of the model, the global feature alignment loss value is :
Figure PCTCN2020116742-appb-000003
Figure PCTCN2020116742-appb-000003
其中,n为所述图像样本集中的所述图像样本的总数量;D i为在所述图像样本集中的第i个所述图像样本关联的域标签(例如:D i=0表示源域标签,D i=1表示目标域标签);p i为与第i个所述图像样本对应的所述特征向量图对应的全局域分类结果。 Wherein, n is the total number of sample images of the image sample set; D i is set in the sample image associated with the i-th sample image domain label (for example: D i = 0 denotes the source domain tag , D i = 1 represents the target domain label); p i is the global domain classification result corresponding to the feature vector graph corresponding to the i-th image sample.
如此,本申请实现了通过对所述特征向量图进行正则化处理、全局特征提取处理和分类识别,得到与所述特征向量图对应的所述全局域分类结果,并得到所述特征正则损失值和所述全局特征对齐损失值,因此,引入特征正则损失值和全局特征对齐损失值,能够提 升了域自适应模型的鲁棒性和准确性,并且提高了模型的训练效率。In this way, this application realizes that by performing regularization processing, global feature extraction processing, and classification recognition on the feature vector graph, the global domain classification result corresponding to the feature vector graph is obtained, and the feature regular loss value is obtained The loss value is aligned with the global feature. Therefore, the introduction of the feature regular loss value and the global feature alignment loss value can improve the robustness and accuracy of the domain adaptive model, and improve the training efficiency of the model.
S50,通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值。S50: Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the source domain image sample corresponding The category label obtains the detection loss value; and the total loss value is obtained according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value and the feature regular loss value.
可理解地,所述检测模型只对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,所述边界回归为定位出与所述源域图像样本对应的区域特征向量图中的目标图像区域,所述目标图像区域为需要对该区域进行图像识别的区域,即所述目标图像区域能够体现出所述源域图像样本的类别特征,所述源域分类识别为对与所述源域图像样本对应的区域特征向量图中的目标图像区域提取所述图像特征,所述图像特征还包括与源域图像样本的类别相关的图像特征,根据提取的该图像特征进行预测识别,识别出所述源域图像样本的类别,提取与源域图像样本的类别相关的图像特征的方法可以根据需求设定,优选为VGG16的神经网络模型的提取方法,从而得到所述识别结果,所述识别结果表征了所述源域图像样本中包含的类别,通过交叉熵算法,计算出所述识别结果和与所述源域图像样本对应的类别标签之间的损失值,即所述检测损失值。Understandably, the detection model only performs boundary regression and source domain classification and recognition on the area feature vector map corresponding to the source domain image sample, and the boundary regression is to locate the area feature corresponding to the source domain image sample The target image area in the vector graph, the target image area is the area that needs to be image recognized, that is, the target image area can reflect the category characteristics of the source domain image sample, and the source domain classification is recognized as The image feature is extracted from the target image area in the area feature vector diagram corresponding to the source domain image sample, and the image feature also includes the image feature related to the category of the source domain image sample, and the process is performed based on the extracted image feature Predictive recognition, to identify the category of the source domain image sample, and the method of extracting image features related to the source domain image sample category can be set according to requirements, preferably the extraction method of the neural network model of VGG16, so as to obtain the recognition As a result, the recognition result characterizes the category contained in the source domain image sample, and the loss value between the recognition result and the category label corresponding to the source domain image sample is calculated through the cross-entropy algorithm, that is, the loss value between the recognition result and the category label corresponding to the source domain image sample is calculated. The detection loss value.
其中,将所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值输入总损失函数中,通过所述总损失函数计算得出所述总损失值;所述中损失值为:Wherein, the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value are input into a total loss function, and the total loss is calculated by the total loss function Value; the median loss value is:
L=λ 1L global2L local3L detection4L norm L=λ 1 L global2 L local3 L detection4 L norm
其中,λ 1为所述全局特征对齐损失值的权重;L global为所述全局特征对齐损失值;λ 2为所述局部特征对齐损失值的权重;L local为所述局部特征对齐损失值;λ 3为所述检测损失值的权重;L detection为所述检测损失值;λ 4为所述特征正则损失值的权重;L norm为所述特征正则损失值。 Where λ 1 is the weight of the global feature alignment loss value; L global is the global feature alignment loss value; λ 2 is the weight of the local feature alignment loss value; L local is the local feature alignment loss value; λ 3 is the weight of the detection loss value; L detection is the detection loss value; λ 4 is the weight of the feature regular loss value; L norm is the feature regular loss value.
S60,在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。S60: When the total loss value does not reach a preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, converge all subsequent parameters. The domain adaptive model is recorded as the domain adaptive model after training.
可理解地,所述收敛条件可以为所述总损失值经过了50000次计算后值为很小且不会再下降的条件,即在所述总损失值经过50000次计算后值为很小且不会再下降时,停止训练,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型;所述收敛条件也可以为所述总损失值小于设定阈值的条件,即在所述总损失值小于设定阈值时,停止训练,并将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。Understandably, the convergence condition may be a condition that the value of the total loss value is small and will not drop after 50,000 calculations, that is, the value of the total loss value is small and will not decrease after 50,000 calculations. When it will no longer drop, stop training, and record the domain adaptive model after convergence as the completed domain adaptive model; the convergence condition can also be the condition that the total loss value is less than the set threshold, that is, When the total loss value is less than the set threshold, the training is stopped, and the domain adaptive model after convergence is recorded as the trained domain adaptive model.
如此,在所述总损失值未达到预设的收敛条件时,不断更新迭代所述域自适应模型的初始参数,可以不断靠拢,逐渐减小源域图像样本和目标域图像样本之间的数据分布差异,进而实现在源域图像样本的知识上迁移学习目标域图像样本的知识,利用已有的源域图像样本的知识通过算法来学习目标域图像样本的知识,即找到源域图像样本的知识与目标域图像样本的知识之间的相似性,从而能够实现在源域图像样本的类别基础上对目标域图像样本的识别,并让识别的准确率越来越高。In this way, when the total loss value does not reach the preset convergence condition, the initial parameters of the iterative domain adaptive model can be continuously updated, and the data between the source domain image samples and the target domain image samples can be gradually reduced. Distribution difference, and then realize the transfer of the knowledge of the source domain image sample to learn the knowledge of the target domain image sample, use the existing source domain image sample knowledge to learn the knowledge of the target domain image sample through the algorithm, that is, find the source domain image sample The similarity between the knowledge and the knowledge of the target domain image sample can realize the recognition of the target domain image sample based on the category of the source domain image sample, and make the recognition accuracy rate higher and higher.
如此,本申请实现了通过获取含有多个图像样本的图像样本集;所述图像样本包括源域图像样本和目标域图像样本;将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类 识别,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局特征对齐损失值;通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;在所述总损失值未达到预设的收敛条件时,迭代更新初始参数直至收敛,得到训练完成的域自适应模型,因此,本申请提供了一种域自适应模型训练方法,通过获取源域和目标域的图像样本进行训练,无需对目标域的图像样本进行人工标签,通过全局特征对齐和局部特征对齐的方式对不同域源头的图像数据的分布差异进行自适应,提高了域自适应模型的训练效率,并引入特征正则损失值,提升了域自适应模型的鲁棒性和准确性,如此,实现了通过不同域的图像样本进行训练,并根据含有全局特征对齐损失值、检测损失值、局部特征对齐损失值和特征正则损失值的总损失值,对基于Faster-RCNN的域自适应模型进行收敛,实现了跨域的图像识别,提高了图像识别的准确性和可靠性,节省了人工成本。In this way, this application realizes that by acquiring an image sample set containing multiple image samples; the image samples include source domain image samples and target domain image samples; inputting the image samples into a Faster-RCNN-based domain automaton containing initial parameters An adaptive model is used to perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector map; and use the region extraction model to perform image feature extraction on the preprocessed image Perform region extraction and equalization sampling on the feature vector image to obtain a regional feature vector image; perform local feature extraction processing and binary classification recognition on the region feature vector image corresponding to the image sample through the local feature model to obtain local features Alignment loss value; At the same time, the feature vector graph is regularized and global feature recognition processing is performed through the global feature model to obtain the feature regularization loss value and the global feature alignment loss value; the detection model is used to compare with the source domain image The regional feature vector map corresponding to the sample performs boundary regression and source domain classification and identification to obtain a detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value and the feature regular loss value , The total loss value is obtained; when the total loss value does not reach the preset convergence condition, the initial parameters are updated iteratively until convergence, and the trained domain adaptive model is obtained. Therefore, this application provides a domain adaptive model training The method is to obtain image samples of the source and target domains for training, without artificial labeling of the image samples of the target domain, and adaptively adapt to the distribution differences of the image data of different domain sources through global feature alignment and local feature alignment. The training efficiency of the domain adaptive model is improved, and the feature regular loss value is introduced, which improves the robustness and accuracy of the domain adaptive model. In this way, it is possible to train through image samples in different domains and align them according to the global features. The total loss value of loss value, detection loss value, local feature alignment loss value and feature regular loss value, converges the domain adaptive model based on Faster-RCNN, realizes cross-domain image recognition, and improves the accuracy of image recognition And reliability, saving labor costs.
本申请提供的图像检测方法,可应用在如图1的应用环境中,其中,客户端(计算机设备)通过网络与服务器进行通信。其中,客户端(计算机设备)包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑、摄像头和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The image detection method provided by this application can be applied in the application environment as shown in Fig. 1, in which the client (computer equipment) communicates with the server through the network. Among them, the client (computer equipment) includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices. The server can be implemented as an independent server or a server cluster composed of multiple servers.
在一实施例中,如图7示,提供一种图像检测方法,其技术方案主要包括以下步骤S100-S200:In an embodiment, as shown in FIG. 7, an image detection method is provided, and the technical solution mainly includes the following steps S100-S200:
S100,接收到图像检测指令,获取待检测目标域图像。S100. An image detection instruction is received, and an image of a target area to be detected is acquired.
可理解地,在与采集所述目标域图像样本相同的设备上采集所述待检测目标域图像,所述待检测目标域图像为需要进行识别的且与采集所述目标域图像样本相同的设备上采集的图像,在对所述待检测目标域图像进行识别时触发所述图像检测指令,所述图像检测指令的触发方式可以根据需求设定,比如采集完所述待检测目标域图像后自动触发,或者在采集完所述待检测目标域图像后通过点击确定按键方式触发,其中,获取所述待检测目标域图像的方式也可以根据需求设定,比如可以通过所述图像检测指令中的存储所述待检测目标域图像的路径进行获取,也可以在还有所述待检测目标域图像的所述图像检测指令中获取等等。Understandably, the image of the target area to be detected is acquired on the same device as the image sample of the target area, and the image of the target area to be detected is the same device that needs to be identified and is the same as the device that collects the target area image sample The image detection instruction is triggered when the image of the target area to be detected is recognized. The trigger mode of the image detection instruction can be set according to requirements, for example, automatically after the image of the target area to be detected is collected Trigger, or by clicking the OK button after collecting the image of the target area to be detected. The method of acquiring the image of the target area to be detected can also be set according to requirements. For example, it can be triggered by The path of storing the image of the target area to be detected for acquisition may also be obtained in the image detection instruction of the image of the target area to be detected, and so on.
S200,将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。S200. Input the image of the target domain to be detected into the image detection model trained as described in the above-mentioned domain adaptive model training method, and extract the image features in the image of the target domain to be detected through the image detection model to obtain the image detection The model outputs the source domain category result according to the image feature.
可理解地,只需将所述待检测目标域图像输入训练完成的图像检测模型,通过所述图像检测模型进行所述图像特征的提取,所述图像特征包括所述图像特征为图像中的颜色特征、纹理特征、形状特征和空间关系特征,以及与源域图像样本的类别相关的图像特征,所述图像检测模型为通过上述域自适应模型训练方法进行训练并训练完成,根据提取的所述图像特征输出所述源域类别结果,所述源域类别结果的类别与所述类别标签的全集相同,所述源域类别结果表征了所述待检测目标域图像的类别。Understandably, it is only necessary to input the image of the target area to be detected into the trained image detection model, and extract the image feature through the image detection model. The image feature includes the image feature being the color in the image. Features, texture features, shape features, and spatial relationship features, as well as image features related to the category of source domain image samples. The image detection model is trained and completed by the above-mentioned domain adaptive model training method. According to the extracted The image feature outputs the source domain category result, the category of the source domain category result is the same as the full set of category labels, and the source domain category result represents the category of the target domain image to be detected.
如此,本申请实现了通过获取待检测目标域图像;将所述待检测目标域图像输入如上述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果,因此,本申请通过域自适应模型自动识别出待检测目标域图像的类别,实现了跨设备或者跨域的图像检测,提高了跨域识别结果的准确性可靠性,及节省了成本。In this way, this application realizes that by acquiring the image of the target domain to be detected; inputting the image of the target domain to be detected into the image detection model trained as the above-mentioned domain adaptive model training method, and extracting the target to be detected through the image detection model The image feature in the domain image is obtained, and the source domain category result output by the image detection model according to the image feature is obtained. Therefore, this application automatically recognizes the category of the target domain image to be detected through the domain adaptive model, realizing cross-device or Cross-domain image detection improves the accuracy and reliability of cross-domain recognition results and saves costs.
在一实施例中,提供一种域自适应模型训练装置,该域自适应模型训练装置与上述实施例中域自适应模型训练方法一一对应。如图8所示,该域自适应模型训练装置包括获取模块11、输入模块12、提取模块13、第一损失模块14、第二损失模块15和训练模块16。 各功能模块详细说明如下:In one embodiment, a domain adaptive model training device is provided, and the domain adaptive model training device corresponds to the domain adaptive model training method in the above-mentioned embodiment in a one-to-one correspondence. As shown in FIG. 8, the domain adaptive model training device includes an acquisition module 11, an input module 12, an extraction module 13, a first loss module 14, a second loss module 15 and a training module 16. The detailed description of each functional module is as follows:
获取模块11,用于获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;The obtaining module 11 is used to obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample, one category label, and one Domain label association; one of the target domain image samples is associated with one domain label;
输入模块12,用于将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The input module 12 is configured to input the image sample into a Faster-RCNN-based domain adaptation model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; the domain adaptation The model includes the preprocessing model, feature extraction model, region extraction model, detection model, global feature model, and local feature model;
提取模块13,用于通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;The extraction module 13 is configured to perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector image;
第一损失模块14,用于通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;The first loss module 14 is configured to perform region extraction and equal sampling of the feature vector map through the region extraction model to obtain a region feature vector map; and use the local feature model to perform regional feature vectors corresponding to the image samples The map performs local feature extraction processing and binary classification recognition to obtain a local domain classification result, and according to the local domain classification result and the domain label corresponding to the image sample, the local feature alignment loss value is obtained; at the same time, the global feature model is passed Perform regularization and global feature recognition processing on the feature vector graph to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment according to the global domain classification result and the domain label corresponding to the feature vector graph Loss value
第二损失模块15,用于通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;The second loss module 15 is configured to perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model, to obtain the recognition result, and to obtain the recognition result according to the recognition result and the comparison with the The category label corresponding to the source domain image sample obtains the detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value, a total loss value is obtained;
训练模块16,用于在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。The training module 16 is configured to iteratively update the initial parameters of the domain adaptive model when the total loss value does not reach the preset convergence condition, until the total loss value reaches the preset convergence condition, The domain adaptive model after convergence is recorded as a trained domain adaptive model.
在一实施例中,所述输入模块12包括:In an embodiment, the input module 12 includes:
匹配子模块,用于根据预设的尺寸参数,通过所述预处理模型对所述图像样本进行尺寸匹配,得到匹配图像样本;The matching sub-module is configured to perform size matching on the image sample through the preprocessing model according to preset size parameters to obtain a matching image sample;
转换子模块,用于根据伽马变换算法,通过所述预处理模型对所述匹配图像样本进行去噪及图像增强处理,得到所述预处理图像样本。The conversion sub-module is configured to perform denoising and image enhancement processing on the matched image samples through the preprocessing model according to the gamma transformation algorithm to obtain the preprocessed image samples.
在一实施例中,所述第一损失模块14包括:In an embodiment, the first loss module 14 includes:
提取子模块,用于通过所述区域提取模型中的区域提取网络层对所述特征向量图进行区域提取,得到至少一个候选区域框;An extraction sub-module, configured to perform region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame;
池化子模块,用于通过所述区域提取模型中的感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图。The pooling sub-module is used to perform balanced sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
在一实施例中,所述第一损失模块14还包括:In an embodiment, the first loss module 14 further includes:
局部提取子模块,用于通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图;The local extraction sub-module is used to perform local feature extraction on the regional feature vector map by the feature extractor in the local feature model to obtain a local feature vector map;
局部分类子模块,用于通过所述局部特征模型中的域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果;The local classification sub-module is used to perform two-class recognition on the local feature vector graph through the domain classifier in the local feature model to obtain the local domain classification result;
局部反转子模块,用于通过所述局部特征模型中的梯度反转层对所述局部域分类结果进行取反对齐,得到反向域标签;The local inversion sub-module is used to reverse and align the local domain classification results through the gradient inversion layer in the local feature model to obtain a reverse domain label;
局部损失子模块,用于通过所述局部特征模型中的域差异度量器所述反向域标签和与所述区域特征向量图对应的域标签进行差异对比,得到所述局部特征对齐损失值。The local loss sub-module is used to compare the difference between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference measurer in the local feature model to obtain the local feature alignment loss value.
在一实施例中,所述第一损失模块14还包括:In an embodiment, the first loss module 14 further includes:
全局正则子模块,用于通过所述全局特征模型中的特征正则模型对所述特征向量图进 行正则化处理,得到全局正则特征图,同时通过所述特征正则模型中的正则损失函数计算出所述特征正则损失值;The global regularization sub-module is used to regularize the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature map, and at the same time, calculate all the features through the regular loss function in the feature regular model. The regular loss value of the characteristic;
全局分类子模块,用于通过所述全局特征模型对所述全局正则特征图进行全局特征提取处理和分类识别,得到所述全局域分类结果;A global classification sub-module, configured to perform global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result;
全局损失子模块,用于将所述全局域分类结果和与所述特征向量图对应的域标签输入全局损失模型中,通过所述全局损失模型计算出所述全局域分类结果和与所述特征向量图对应的域标签之间的差异,得出所述全局特征对齐损失值。The global loss sub-module is used to input the global domain classification result and the domain label corresponding to the feature vector graph into a global loss model, and calculate the global domain classification result and the feature by the global loss model The difference between the domain labels corresponding to the vector graph is used to obtain the global feature alignment loss value.
关于域自适应模型训练装置的具体限定可以参见上文中对于域自适应模型训练方法的限定,在此不再赘述。上述域自适应模型训练装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the domain adaptive model training device, please refer to the above definition of the domain adaptive model training method, which will not be repeated here. Each module in the above-mentioned domain adaptive model training device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一实施例中,提供一种图像检测装置,该图像检测装置与上述实施例中图像检测方法一一对应。如图9所示,该图像检测装置包括接收模块101和检测模块102。各功能模块详细说明如下:In an embodiment, an image detection device is provided, and the image detection device corresponds to the image detection method in the above-mentioned embodiment one-to-one. As shown in FIG. 9, the image detection device includes a receiving module 101 and a detection module 102. The detailed description of each functional module is as follows:
接收模块101,用于接收到图像检测指令,获取待检测目标域图像;The receiving module 101 is configured to receive an image detection instruction and obtain an image of a target area to be detected;
检测模块102,用于将所述待检测目标域图像输入如权利要求1至5任一项所述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The detection module 102 is configured to input the image of the target domain to be detected into the image detection model trained by the domain adaptive model training method according to any one of claims 1 to 5, and extract the image to be detected from the image detection model The image feature in the target domain image is obtained, and the source domain classification result output by the image detection model according to the image feature is obtained.
关于图像检测装置的具体限定可以参见上文中对于图像检测方法的限定,在此不再赘述。上述图像检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the image detection device, please refer to the above definition of the image detection method, which will not be repeated here. Each module in the above-mentioned image detection device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种域自适应模型训练方法,或者图像检测方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 10. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer-readable instructions are executed by the processor to implement a domain adaptive model training method or image detection method. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例中域自适应模型训练方法,或者处理器执行计算机程序时实现上述实施例中图像检测方法。In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor. When the processor executes the computer-readable instructions, the domains in the foregoing embodiments are implemented. The adaptive model training method, or the processor executes the computer program to implement the image detection method in the above embodiment.
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质;该可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现上述实施例中图像检测方法。In one embodiment, one or more readable storage media storing computer readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage. Medium; the readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by one or more processors, the one or more processors implement the image detection method in the above-mentioned embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质或易失性可读存储介质中,,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或 者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer. In a readable storage medium or a volatile readable storage medium, when the computer readable instruction is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database, or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种域自适应模型训练方法,其中,包括:A domain adaptive model training method, which includes:
    获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
    将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
    通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
    通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
    通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
    在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
  2. 如权利要求1所述的域自适应模型训练方法,其中,所述通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本,包括:The method for training a domain adaptive model according to claim 1, wherein said performing image conversion on said image samples through a preprocessing model to obtain preprocessed image samples comprises:
    根据预设的尺寸参数,通过所述预处理模型对所述图像样本进行尺寸匹配,得到匹配图像样本;Performing size matching on the image sample through the preprocessing model according to preset size parameters to obtain a matching image sample;
    根据伽马变换算法,通过所述预处理模型对所述匹配图像样本进行去噪及图像增强处理,得到所述预处理图像样本。According to the gamma transform algorithm, the matched image samples are processed for denoising and image enhancement through the preprocessing model to obtain the preprocessed image samples.
  3. 如权利要求1所述的域自适应模型训练方法,其中,所述通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图,包括:5. The domain adaptive model training method according to claim 1, wherein said performing region extraction and equal sampling on said feature vector map by said region extraction model to obtain a region feature vector map comprises:
    通过所述区域提取模型中的区域提取网络层对所述特征向量图进行区域提取,得到至少一个候选区域框;Performing region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame;
    通过所述区域提取模型中的感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图。Perform balanced sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
  4. 如权利要求1所述的域自适应模型训练方法,其中,所述通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值,包括:The domain adaptive model training method according to claim 1, wherein the local feature extraction process and the two-class recognition are performed on the regional feature vector map corresponding to the image sample through the local feature model to obtain the local domain classification As a result, and according to the local domain classification result and the domain label corresponding to the image sample, the local feature alignment loss value is obtained, including:
    通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图;Performing local feature extraction on the regional feature vector map by a feature extractor in the local feature model to obtain a local feature vector map;
    通过所述局部特征模型中的域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果;Performing two-class recognition on the local feature vector graph by using a domain classifier in the local feature model to obtain the local domain classification result;
    通过所述局部特征模型中的梯度反转层对所述局部域分类结果进行取反对齐,得到反向域标签;Inverting and aligning the local domain classification result by using the gradient reversal layer in the local feature model to obtain a reverse domain label;
    通过所述局部特征模型中的域差异度量器所述反向域标签和与所述区域特征向量图对应的域标签进行差异对比,得到所述局部特征对齐损失值。The difference comparison between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference metric in the local feature model is used to obtain the local feature alignment loss value.
  5. 如权利要求1所述的域自适应模型训练方法,其中,所述通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值,包括:3. The domain adaptive model training method according to claim 1, wherein said regularization and global feature recognition processing are performed on said feature vector graph through said global feature model to obtain a feature regularization loss value and a global domain classification result, And according to the global domain classification result and the domain label corresponding to the feature vector graph, the global feature alignment loss value is obtained, including:
    通过所述全局特征模型中的特征正则模型对所述特征向量图进行正则化处理,得到全局正则特征图,同时通过所述特征正则模型中的正则损失函数计算出所述特征正则损失值;Performing regularization processing on the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature graph, and at the same time calculating the feature regular loss value through the regular loss function in the feature regular model;
    通过所述全局特征模型对所述全局正则特征图进行全局特征提取处理和分类识别,得到所述全局域分类结果;Performing global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result;
    将所述全局域分类结果和与所述特征向量图对应的域标签输入全局损失模型中,通过所述全局损失模型计算出所述全局域分类结果和与所述特征向量图对应的域标签之间的差异,得出所述全局特征对齐损失值。The global domain classification result and the domain label corresponding to the feature vector graph are input into a global loss model, and the global domain classification result and the domain label corresponding to the feature vector graph are calculated through the global loss model. And obtain the global feature alignment loss value.
  6. 一种图像检测方法,其中,包括:An image detection method, which includes:
    接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
    将所述待检测目标域图像输入如权利要求1至5任一项所述域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target domain to be detected is input into the image detection model trained by the domain adaptive model training method according to any one of claims 1 to 5, and the image in the image of the target domain to be detected is extracted through the image detection model Feature, acquiring a source domain category result output by the image detection model according to the image feature.
  7. 一种域自适应模型训练装置,其中,包括:A domain adaptive model training device, which includes:
    获取模块,用于获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;The acquisition module is used to acquire an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample, one category label, and one domain Label association; one image sample of the target domain is associated with one domain label;
    输入模块,用于将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The input module is used to input the image sample into a Faster-RCNN-based domain adaptive model containing initial parameters, and perform image conversion on the image sample through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model Including the preprocessing model, feature extraction model, region extraction model, detection model, global feature model, and local feature model;
    提取模块,用于通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;An extraction module, configured to perform image feature extraction on the preprocessed image through the feature extraction model to obtain a feature vector image;
    第一损失模块,用于通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;The first loss module is used to perform region extraction and equal sampling of the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform region feature vector maps corresponding to the image samples Perform local feature extraction processing and binary classification recognition to obtain a local domain classification result, and obtain a local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the global feature model is used to The feature vector graph performs regularization and global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and according to the global domain classification result and the domain label corresponding to the feature vector graph, a global feature alignment loss is obtained value;
    第二损失模块,用于通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;The second loss module is used to perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain the recognition result, and according to the recognition result and the source domain The category label corresponding to the domain image sample obtains the detection loss value; according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value, a total loss value is obtained;
    训练模块,用于在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。The training module is configured to iteratively update the initial parameters of the domain adaptive model when the total loss value does not reach the preset convergence condition, until the total loss value reaches the preset convergence condition, it will converge The subsequent domain adaptive model is recorded as a trained domain adaptive model.
  8. 一种图像检测装置,其中,包括:An image detection device, which includes:
    接收模块,用于接收到图像检测指令,获取待检测目标域图像;The receiving module is used to receive the image detection instruction and obtain the image of the target area to be detected;
    检测模块,用于将所述待检测目标域图像输入如权利要求1至5任一项所述域自适应 模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The detection module is configured to input the image of the target domain to be detected into the image detection model trained by the domain adaptive model training method according to any one of claims 1 to 5, and extract the target to be detected through the image detection model The image feature in the domain image is obtained, and the source domain classification result output by the image detection model according to the image feature is obtained.
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, wherein the processor implements the following steps when the processor executes the computer-readable instructions:
    获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
    将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
    通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
    通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
    通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
    在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
  10. 如权利要求9所述的计算机设备,其中,所述通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本,包括:9. The computer device according to claim 9, wherein said performing image conversion on said image sample through a preprocessing model to obtain a preprocessed image sample comprises:
    根据预设的尺寸参数,通过所述预处理模型对所述图像样本进行尺寸匹配,得到匹配图像样本;Performing size matching on the image sample through the preprocessing model according to preset size parameters to obtain a matching image sample;
    根据伽马变换算法,通过所述预处理模型对所述匹配图像样本进行去噪及图像增强处理,得到所述预处理图像样本。According to the gamma transform algorithm, the matched image samples are processed for denoising and image enhancement through the preprocessing model to obtain the preprocessed image samples.
  11. 如权利要求9所述的计算机设备,其中,所述通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图,包括:9. The computer device according to claim 9, wherein said performing area extraction and equal sampling on said feature vector map through said area extraction model to obtain a regional feature vector map comprises:
    通过所述区域提取模型中的区域提取网络层对所述特征向量图进行区域提取,得到至少一个候选区域框;Performing region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame;
    通过所述区域提取模型中的感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图。Perform balanced sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
  12. 如权利要求9所述的计算机设备,其中,所述通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值,包括:The computer device according to claim 9, wherein the local feature extraction process and the two-class recognition are performed on the regional feature vector map corresponding to the image sample through the local feature model to obtain a local domain classification result, and according to The local domain classification result and the domain label corresponding to the image sample to obtain a local feature alignment loss value includes:
    通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图;Performing local feature extraction on the regional feature vector map by a feature extractor in the local feature model to obtain a local feature vector map;
    通过所述局部特征模型中的域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果;Performing two-class recognition on the local feature vector graph by using a domain classifier in the local feature model to obtain the local domain classification result;
    通过所述局部特征模型中的梯度反转层对所述局部域分类结果进行取反对齐,得到反 向域标签;Performing inverse alignment on the local domain classification result through the gradient reversal layer in the local feature model to obtain a reverse domain label;
    通过所述局部特征模型中的域差异度量器所述反向域标签和与所述区域特征向量图对应的域标签进行差异对比,得到所述局部特征对齐损失值。The difference comparison between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference metric in the local feature model is used to obtain the local feature alignment loss value.
  13. 如权利要求9所述的计算机设备,其中,所述通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值,包括:The computer device according to claim 9, wherein the regularization and global feature recognition processing is performed on the feature vector graph through the global feature model to obtain the feature regularization loss value and the global domain classification result, and according to the The global domain classification result and the domain label corresponding to the feature vector graph are used to obtain the global feature alignment loss value, including:
    通过所述全局特征模型中的特征正则模型对所述特征向量图进行正则化处理,得到全局正则特征图,同时通过所述特征正则模型中的正则损失函数计算出所述特征正则损失值;Performing regularization processing on the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature graph, and at the same time calculating the feature regular loss value through the regular loss function in the feature regular model;
    通过所述全局特征模型对所述全局正则特征图进行全局特征提取处理和分类识别,得到所述全局域分类结果;Performing global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result;
    将所述全局域分类结果和与所述特征向量图对应的域标签输入全局损失模型中,通过所述全局损失模型计算出所述全局域分类结果和与所述特征向量图对应的域标签之间的差异,得出所述全局特征对齐损失值。The global domain classification result and the domain label corresponding to the feature vector graph are input into a global loss model, and the global domain classification result and the domain label corresponding to the feature vector graph are calculated through the global loss model. And obtain the global feature alignment loss value.
  14. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时还实现如下步骤:A computer device includes a memory, a processor, and computer readable instructions stored in the memory and capable of running on the processor, wherein the processor further implements the following steps when executing the computer readable instructions :
    接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
    将所述待检测目标域图像输入通过域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target area to be detected is input into the image detection model trained by the domain adaptive model training method, the image features in the image of the target area to be detected are extracted through the image detection model, and the image detection model is obtained according to the image detection model. The source domain category result of the image feature output.
  15. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer readable instructions, where when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
    获取图像样本集;所述图像样本集包括多个图像样本;所述图像样本包括源域图像样本和目标域图像样本;一个所述源域图像样本与一个类别标签及一个域标签关联;一个所述目标域图像样本与一个域标签关联;Obtain an image sample set; the image sample set includes a plurality of image samples; the image sample includes a source domain image sample and a target domain image sample; one source domain image sample is associated with a category label and a domain label; The target domain image sample is associated with a domain label;
    将所述图像样本输入含有初始参数且基于Faster-RCNN的域自适应模型,通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本;所述域自适应模型包括所述预处理模型、特征提取模型、区域提取模型、检测模型、全局特征模型和局部特征模型;The image sample is input to a Faster-RCNN-based domain adaptive model containing initial parameters, and the image sample is image converted through the preprocessing model to obtain a preprocessed image sample; the domain adaptive model includes the preprocessing Model, feature extraction model, area extraction model, detection model, global feature model and local feature model;
    通过所述特征提取模型对所述预处理图像进行图像特征提取,获取特征向量图;Performing image feature extraction on the preprocessed image by using the feature extraction model to obtain a feature vector diagram;
    通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图;通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值;同时通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值;Perform region extraction and equal sampling on the feature vector map through the region extraction model to obtain a region feature vector map; use the local feature model to perform local feature extraction processing and two steps on the region feature vector map corresponding to the image sample Classification and recognition, obtain the local domain classification result, and obtain the local feature alignment loss value according to the local domain classification result and the domain label corresponding to the image sample; at the same time, the feature vector graph is regularized by the global feature model And global feature recognition processing to obtain a feature regular loss value and a global domain classification result, and obtain a global feature alignment loss value according to the global domain classification result and the domain label corresponding to the feature vector graph;
    通过所述检测模型对与所述源域图像样本对应的区域特征向量图进行边界回归及源域分类识别,得到识别结果,并根据所述识别结果和与所述源域图像样本对应的类别标签得到检测损失值;根据所述全局特征对齐损失值、所述检测损失值、所述局部特征对齐损失值和所述特征正则损失值,得到总损失值;Perform boundary regression and source domain classification and recognition on the region feature vector map corresponding to the source domain image sample through the detection model to obtain a recognition result, and according to the recognition result and the category label corresponding to the source domain image sample Obtain a detection loss value; obtain a total loss value according to the global feature alignment loss value, the detection loss value, the local feature alignment loss value, and the feature regular loss value;
    在所述总损失值未达到预设的收敛条件时,迭代更新所述域自适应模型的初始参数,直至所述总损失值达到所述预设的收敛条件时,将收敛之后的所述域自适应模型记录为训练完成的域自适应模型。When the total loss value does not reach the preset convergence condition, iteratively update the initial parameters of the domain adaptive model, until the total loss value reaches the preset convergence condition, the domain after convergence The adaptive model is recorded as a domain adaptive model that has been trained.
  16. 如权利要求15所述的可读存储介质,其中,所述通过预处理模型对所述图像样本进行图像转换,得到预处理图像样本,包括:15. The readable storage medium according to claim 15, wherein said performing image conversion on said image sample through a preprocessing model to obtain a preprocessed image sample comprises:
    根据预设的尺寸参数,通过所述预处理模型对所述图像样本进行尺寸匹配,得到匹配图像样本;Performing size matching on the image sample through the preprocessing model according to preset size parameters to obtain a matching image sample;
    根据伽马变换算法,通过所述预处理模型对所述匹配图像样本进行去噪及图像增强处理,得到所述预处理图像样本。According to the gamma transform algorithm, the matched image samples are processed for denoising and image enhancement through the preprocessing model to obtain the preprocessed image samples.
  17. 如权利要求15所述的可读存储介质,其中,所述通过所述区域提取模型对所述特征向量图进行区域提取及均衡采样,得到区域特征向量图,包括:15. The readable storage medium according to claim 15, wherein said performing region extraction and equal sampling on said feature vector map by said region extraction model to obtain a region feature vector map comprises:
    通过所述区域提取模型中的区域提取网络层对所述特征向量图进行区域提取,得到至少一个候选区域框;Performing region extraction on the feature vector graph through the region extraction network layer in the region extraction model to obtain at least one candidate region frame;
    通过所述区域提取模型中的感兴趣区域池层对所述特征向量图和所有所述候选区域框进行均衡采样处理,得到区域特征向量图。Perform balanced sampling processing on the feature vector map and all the candidate region frames through the region of interest pool layer in the region extraction model to obtain a region feature vector map.
  18. 如权利要求15所述的可读存储介质,其中,所述通过所述局部特征模型对与所述图像样本对应的区域特征向量图进行局部特征提取处理和二分类识别,得到局部域分类结果,并根据所述局部域分类结果和与所述图像样本对应的域标签,得到局部特征对齐损失值,包括:15. The readable storage medium according to claim 15, wherein the local feature extraction process and the two-class recognition are performed on the regional feature vector map corresponding to the image sample through the local feature model to obtain a local domain classification result, And according to the local domain classification result and the domain label corresponding to the image sample, the local feature alignment loss value is obtained, including:
    通过所述局部特征模型中的特征提取器对所述区域特征向量图进行局部特征提取,得到局部特征向量图;Performing local feature extraction on the regional feature vector map by a feature extractor in the local feature model to obtain a local feature vector map;
    通过所述局部特征模型中的域分类器对所述局部特征向量图进行二分类识别,得到所述局部域分类结果;Performing two-class recognition on the local feature vector graph by using a domain classifier in the local feature model to obtain the local domain classification result;
    通过所述局部特征模型中的梯度反转层对所述局部域分类结果进行取反对齐,得到反向域标签;Inverting and aligning the local domain classification result by using the gradient reversal layer in the local feature model to obtain a reverse domain label;
    通过所述局部特征模型中的域差异度量器所述反向域标签和与所述区域特征向量图对应的域标签进行差异对比,得到所述局部特征对齐损失值。The difference comparison between the reverse domain label and the domain label corresponding to the regional feature vector graph by the domain difference metric in the local feature model is used to obtain the local feature alignment loss value.
  19. 如权利要求15所述的可读存储介质,其中,所述通过所述全局特征模型对所述特征向量图进行正则化及全局特征识别处理,得到特征正则损失值和全局域分类结果,并根据所述全局域分类结果和与所述特征向量图对应的域标签,得到全局特征对齐损失值,包括:The readable storage medium according to claim 15, wherein the regularization and global feature recognition processing is performed on the feature vector graph through the global feature model to obtain a feature regularization loss value and a global domain classification result, and according to The global domain classification result and the domain label corresponding to the feature vector graph to obtain the global feature alignment loss value includes:
    通过所述全局特征模型中的特征正则模型对所述特征向量图进行正则化处理,得到全局正则特征图,同时通过所述特征正则模型中的正则损失函数计算出所述特征正则损失值;Performing regularization processing on the feature vector graph through the feature regular model in the global feature model to obtain a global regular feature graph, and at the same time calculating the feature regular loss value through the regular loss function in the feature regular model;
    通过所述全局特征模型对所述全局正则特征图进行全局特征提取处理和分类识别,得到所述全局域分类结果;Performing global feature extraction processing and classification recognition on the global regular feature map through the global feature model to obtain the global domain classification result;
    将所述全局域分类结果和与所述特征向量图对应的域标签输入全局损失模型中,通过所述全局损失模型计算出所述全局域分类结果和与所述特征向量图对应的域标签之间的差异,得出所述全局特征对齐损失值。The global domain classification result and the domain label corresponding to the feature vector graph are input into a global loss model, and the global domain classification result and the domain label corresponding to the feature vector graph are calculated through the global loss model. And obtain the global feature alignment loss value.
  20. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:One or more readable storage media storing computer readable instructions, where when the computer readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
    接收到图像检测指令,获取待检测目标域图像;The image detection instruction is received, and the image of the target area to be detected is obtained;
    将所述待检测目标域图像输入通过域自适应模型训练方法训练完成的图像检测模型,通过所述图像检测模型提取所述待检测目标域图像中的图像特征,获取所述图像检测模型根据所述图像特征输出的源域类别结果。The image of the target domain to be detected is input into the image detection model trained by the domain adaptive model training method, the image features in the image of the target domain to be detected are extracted through the image detection model, and the image detection model is acquired according to the image detection model. The source domain category result of the image feature output.
PCT/CN2020/116742 2020-07-28 2020-09-22 Region-based self-adaptive model training method and device, image detection method and device, and apparatus and medium WO2021120752A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010737198.7A CN111860670B (en) 2020-07-28 2020-07-28 Domain adaptive model training method, image detection method, device, equipment and medium
CN202010737198.7 2020-07-28

Publications (1)

Publication Number Publication Date
WO2021120752A1 true WO2021120752A1 (en) 2021-06-24

Family

ID=72948336

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116742 WO2021120752A1 (en) 2020-07-28 2020-09-22 Region-based self-adaptive model training method and device, image detection method and device, and apparatus and medium

Country Status (2)

Country Link
CN (1) CN111860670B (en)
WO (1) WO2021120752A1 (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113343989A (en) * 2021-07-09 2021-09-03 中山大学 Target detection method and system based on self-adaption of foreground selection domain
CN113392933A (en) * 2021-07-06 2021-09-14 湖南大学 Self-adaptive cross-domain target detection method based on uncertainty guidance
CN113469092A (en) * 2021-07-13 2021-10-01 深圳思谋信息科技有限公司 Character recognition model generation method and device, computer equipment and storage medium
CN113658036A (en) * 2021-08-23 2021-11-16 平安科技(深圳)有限公司 Data augmentation method, device, computer and medium based on countermeasure generation network
CN113705685A (en) * 2021-08-30 2021-11-26 平安科技(深圳)有限公司 Disease feature recognition model training method, disease feature recognition device and disease feature recognition equipment
CN113792576A (en) * 2021-07-27 2021-12-14 北京邮电大学 Human behavior recognition method based on supervised domain adaptation and electronic equipment
CN113807420A (en) * 2021-09-06 2021-12-17 湖南大学 Domain self-adaptive target detection method and system considering category semantic matching
CN113887538A (en) * 2021-11-30 2022-01-04 北京的卢深视科技有限公司 Model training method, face recognition method, electronic device and storage medium
CN114065852A (en) * 2021-11-11 2022-02-18 合肥工业大学 Multi-source combined self-adaption and cohesion feature extraction method based on dynamic weight
CN114119585A (en) * 2021-12-01 2022-03-01 昆明理工大学 Method for identifying key feature enhanced gastric cancer image based on Transformer
CN114694146A (en) * 2022-03-25 2022-07-01 北京世纪好未来教育科技有限公司 Training method of text recognition model, text recognition method, device and equipment
CN114898111A (en) * 2022-04-26 2022-08-12 北京百度网讯科技有限公司 Pre-training model generation method and device, and target detection method and device
CN115456917A (en) * 2022-11-11 2022-12-09 中国石油大学(华东) Image enhancement method, device, equipment and medium beneficial to accurate target detection
CN115641584A (en) * 2022-12-26 2023-01-24 武汉深图智航科技有限公司 Foggy day image identification method and device
CN116883735A (en) * 2023-07-05 2023-10-13 江南大学 Domain self-adaptive wheat seed classification method based on public features and private features
CN116894839A (en) * 2023-09-07 2023-10-17 深圳市谱汇智能科技有限公司 Chip wafer defect detection method, device, terminal equipment and storage medium
CN117297554A (en) * 2023-11-16 2023-12-29 哈尔滨海鸿基业科技发展有限公司 Control system and method for lymphatic imaging device
CN117372791A (en) * 2023-12-08 2024-01-09 齐鲁空天信息研究院 Fine grain directional damage area detection method, device and storage medium
CN117648576A (en) * 2024-01-24 2024-03-05 腾讯科技(深圳)有限公司 Data enhancement model training and data processing method, device, equipment and medium

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112183788B (en) * 2020-11-30 2021-03-30 华南理工大学 Domain adaptive equipment operation detection system and method
CN113160135A (en) * 2021-03-15 2021-07-23 华南理工大学 Intelligent colon lesion identification method, system and medium based on unsupervised migration image classification
CN112710632A (en) * 2021-03-23 2021-04-27 四川京炜交通工程技术有限公司 Method and system for detecting high and low refractive indexes of glass beads
CN113222997A (en) * 2021-03-31 2021-08-06 上海商汤智能科技有限公司 Neural network generation method, neural network image processing device, electronic device, and medium
CN113033557A (en) * 2021-04-16 2021-06-25 北京百度网讯科技有限公司 Method and device for training image processing model and detecting image
CN113177525A (en) * 2021-05-27 2021-07-27 杭州有赞科技有限公司 AI electronic scale system and weighing method
CN113392886A (en) * 2021-05-31 2021-09-14 北京达佳互联信息技术有限公司 Method and device for acquiring picture recognition model, electronic equipment and storage medium
CN113469190B (en) * 2021-06-10 2023-09-15 电子科技大学 Single-stage target detection algorithm based on domain adaptation
CN113269278B (en) * 2021-07-16 2021-11-09 广东众聚人工智能科技有限公司 Robot cruising target identification method and system based on field overturning
CN113591639A (en) * 2021-07-20 2021-11-02 北京爱笔科技有限公司 Training method and device for alignment framework, computer equipment and storage medium
CN113269190B (en) * 2021-07-21 2021-10-12 中国平安人寿保险股份有限公司 Data classification method and device based on artificial intelligence, computer equipment and medium
CN113554013B (en) * 2021-09-22 2022-03-29 华南理工大学 Cross-scene recognition model training method, cross-scene road recognition method and device
CN115131590B (en) * 2022-09-01 2022-12-06 浙江大华技术股份有限公司 Training method of target detection model, target detection method and related equipment
CN116028821B (en) * 2023-03-29 2023-06-13 中电科大数据研究院有限公司 Pre-training model training method integrating domain knowledge and data processing method
CN117078985B (en) * 2023-10-17 2024-01-30 之江实验室 Scene matching method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241321A (en) * 2018-07-19 2019-01-18 杭州电子科技大学 The image and model conjoint analysis method adapted to based on depth field
CN110399856A (en) * 2019-07-31 2019-11-01 上海商汤临港智能科技有限公司 Feature extraction network training method, image processing method, device and its equipment
CN110516671A (en) * 2019-08-27 2019-11-29 腾讯科技(深圳)有限公司 Training method, image detecting method and the device of neural network model
US20200143248A1 (en) * 2017-07-12 2020-05-07 Tencent Technology (Shenzhen) Company Limited Machine learning model training method and device, and expression image classification method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930841B (en) * 2016-05-13 2018-01-26 百度在线网络技术(北京)有限公司 The method, apparatus and computer equipment of automatic semantic tagger are carried out to image
US10402701B2 (en) * 2017-03-17 2019-09-03 Nec Corporation Face recognition system for face recognition in unlabeled videos with domain adversarial learning and knowledge distillation
CN109145766B (en) * 2018-07-27 2021-03-23 北京旷视科技有限公司 Model training method and device, recognition method, electronic device and storage medium
CN109086437B (en) * 2018-08-15 2021-06-01 重庆大学 Image retrieval method fusing fast-RCNN and Wasserstein self-encoder
CN110852368B (en) * 2019-11-05 2022-08-26 南京邮电大学 Global and local feature embedding and image-text fusion emotion analysis method and system
CN111368886B (en) * 2020-02-25 2023-03-21 华南理工大学 Sample screening-based label-free vehicle picture classification method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200143248A1 (en) * 2017-07-12 2020-05-07 Tencent Technology (Shenzhen) Company Limited Machine learning model training method and device, and expression image classification method and device
CN109241321A (en) * 2018-07-19 2019-01-18 杭州电子科技大学 The image and model conjoint analysis method adapted to based on depth field
CN110399856A (en) * 2019-07-31 2019-11-01 上海商汤临港智能科技有限公司 Feature extraction network training method, image processing method, device and its equipment
CN110516671A (en) * 2019-08-27 2019-11-29 腾讯科技(深圳)有限公司 Training method, image detecting method and the device of neural network model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG XIAOWE , LYU MINGQIANG , LI HUI: "Cross-Domain Person Re-Identification Based on Partial Semantic Feature Invariance", JOURNAL OF BEIJING UNIVERSITY OF AERONAUTICS AND ASTRONAUTICS, vol. 46, no. 9, 15 April 2020 (2020-04-15), pages 1682 - 1690, XP055823405, ISSN: 1001-5965, DOI: 10.13700/j.bh.1001-5965.2020.0072 *

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392933A (en) * 2021-07-06 2021-09-14 湖南大学 Self-adaptive cross-domain target detection method based on uncertainty guidance
CN113343989B (en) * 2021-07-09 2022-09-27 中山大学 Target detection method and system based on self-adaption of foreground selection domain
CN113343989A (en) * 2021-07-09 2021-09-03 中山大学 Target detection method and system based on self-adaption of foreground selection domain
CN113469092B (en) * 2021-07-13 2023-09-08 深圳思谋信息科技有限公司 Character recognition model generation method, device, computer equipment and storage medium
CN113469092A (en) * 2021-07-13 2021-10-01 深圳思谋信息科技有限公司 Character recognition model generation method and device, computer equipment and storage medium
CN113792576A (en) * 2021-07-27 2021-12-14 北京邮电大学 Human behavior recognition method based on supervised domain adaptation and electronic equipment
CN113658036A (en) * 2021-08-23 2021-11-16 平安科技(深圳)有限公司 Data augmentation method, device, computer and medium based on countermeasure generation network
CN113705685B (en) * 2021-08-30 2023-08-01 平安科技(深圳)有限公司 Disease feature recognition model training, disease feature recognition method, device and equipment
CN113705685A (en) * 2021-08-30 2021-11-26 平安科技(深圳)有限公司 Disease feature recognition model training method, disease feature recognition device and disease feature recognition equipment
CN113807420A (en) * 2021-09-06 2021-12-17 湖南大学 Domain self-adaptive target detection method and system considering category semantic matching
CN113807420B (en) * 2021-09-06 2024-03-19 湖南大学 Domain self-adaptive target detection method and system considering category semantic matching
CN114065852B (en) * 2021-11-11 2024-04-16 合肥工业大学 Multisource joint self-adaption and cohesive feature extraction method based on dynamic weight
CN114065852A (en) * 2021-11-11 2022-02-18 合肥工业大学 Multi-source combined self-adaption and cohesion feature extraction method based on dynamic weight
CN113887538B (en) * 2021-11-30 2022-03-25 北京的卢深视科技有限公司 Model training method, face recognition method, electronic device and storage medium
CN113887538A (en) * 2021-11-30 2022-01-04 北京的卢深视科技有限公司 Model training method, face recognition method, electronic device and storage medium
CN114119585B (en) * 2021-12-01 2022-11-29 昆明理工大学 Method for identifying key feature enhanced gastric cancer image based on Transformer
CN114119585A (en) * 2021-12-01 2022-03-01 昆明理工大学 Method for identifying key feature enhanced gastric cancer image based on Transformer
CN114694146A (en) * 2022-03-25 2022-07-01 北京世纪好未来教育科技有限公司 Training method of text recognition model, text recognition method, device and equipment
CN114694146B (en) * 2022-03-25 2024-04-02 北京世纪好未来教育科技有限公司 Training method of text recognition model, text recognition method, device and equipment
CN114898111A (en) * 2022-04-26 2022-08-12 北京百度网讯科技有限公司 Pre-training model generation method and device, and target detection method and device
CN114898111B (en) * 2022-04-26 2023-04-07 北京百度网讯科技有限公司 Pre-training model generation method and device, and target detection method and device
CN115456917A (en) * 2022-11-11 2022-12-09 中国石油大学(华东) Image enhancement method, device, equipment and medium beneficial to accurate target detection
CN115456917B (en) * 2022-11-11 2023-02-17 中国石油大学(华东) Image enhancement method, device, equipment and medium beneficial to accurate target detection
CN115641584A (en) * 2022-12-26 2023-01-24 武汉深图智航科技有限公司 Foggy day image identification method and device
CN116883735B (en) * 2023-07-05 2024-03-08 江南大学 Domain self-adaptive wheat seed classification method based on public features and private features
CN116883735A (en) * 2023-07-05 2023-10-13 江南大学 Domain self-adaptive wheat seed classification method based on public features and private features
CN116894839B (en) * 2023-09-07 2023-12-05 深圳市谱汇智能科技有限公司 Chip wafer defect detection method, device, terminal equipment and storage medium
CN116894839A (en) * 2023-09-07 2023-10-17 深圳市谱汇智能科技有限公司 Chip wafer defect detection method, device, terminal equipment and storage medium
CN117297554A (en) * 2023-11-16 2023-12-29 哈尔滨海鸿基业科技发展有限公司 Control system and method for lymphatic imaging device
CN117372791A (en) * 2023-12-08 2024-01-09 齐鲁空天信息研究院 Fine grain directional damage area detection method, device and storage medium
CN117372791B (en) * 2023-12-08 2024-03-22 齐鲁空天信息研究院 Fine grain directional damage area detection method, device and storage medium
CN117648576A (en) * 2024-01-24 2024-03-05 腾讯科技(深圳)有限公司 Data enhancement model training and data processing method, device, equipment and medium
CN117648576B (en) * 2024-01-24 2024-04-12 腾讯科技(深圳)有限公司 Data enhancement model training and data processing method, device, equipment and medium

Also Published As

Publication number Publication date
CN111860670A (en) 2020-10-30
CN111860670B (en) 2022-05-17

Similar Documents

Publication Publication Date Title
WO2021120752A1 (en) Region-based self-adaptive model training method and device, image detection method and device, and apparatus and medium
WO2020238293A1 (en) Image classification method, and neural network training method and apparatus
WO2019232853A1 (en) Chinese model training method, chinese image recognition method, device, apparatus and medium
CN110909820B (en) Image classification method and system based on self-supervision learning
WO2016145940A1 (en) Face authentication method and device
US9928405B2 (en) System and method for detecting and tracking facial features in images
WO2018054283A1 (en) Face model training method and device, and face authentication method and device
WO2016150240A1 (en) Identity authentication method and apparatus
WO2015096565A1 (en) Method and device for identifying target object in image
WO2014205231A1 (en) Deep learning framework for generic object detection
CN110909618B (en) Method and device for identifying identity of pet
Zhang et al. Road recognition from remote sensing imagery using incremental learning
Abdelsamea et al. A SOM-based Chan–Vese model for unsupervised image segmentation
Wang et al. Hand vein recognition based on multi-scale LBP and wavelet
CN111091129B (en) Image salient region extraction method based on manifold ordering of multiple color features
Zarbakhsh et al. Low-rank sparse coding and region of interest pooling for dynamic 3D facial expression recognition
Yang et al. Non-rigid point set registration via global and local constraints
Kalam et al. Gaussian Kernel Based Fuzzy CMeans Clustering Algorithm For Image Segmentation
CN113313179A (en) Noise image classification method based on l2p norm robust least square method
Ge et al. Active appearance models using statistical characteristics of gabor based texture representation
US9659210B1 (en) System and method for detecting and tracking facial features in images
Pathak et al. Entropy based CNN for segmentation of noisy color eye images using color, texture and brightness contour features
CN111488811A (en) Face recognition method and device, terminal equipment and computer readable medium
CN111768436B (en) Improved image feature block registration method based on fast-RCNN
WO2020247494A1 (en) Cross-matching contactless fingerprints against legacy contact-based fingerprints

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: 20900968

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20900968

Country of ref document: EP

Kind code of ref document: A1