WO2025010945A1 - 视觉问答模型的训练、视觉问答任务处理方法及装置 - Google Patents

视觉问答模型的训练、视觉问答任务处理方法及装置 Download PDF

Info

Publication number
WO2025010945A1
WO2025010945A1 PCT/CN2023/138801 CN2023138801W WO2025010945A1 WO 2025010945 A1 WO2025010945 A1 WO 2025010945A1 CN 2023138801 W CN2023138801 W CN 2023138801W WO 2025010945 A1 WO2025010945 A1 WO 2025010945A1
Authority
WO
WIPO (PCT)
Prior art keywords
initial
answer
model
data
question answering
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2023/138801
Other languages
English (en)
French (fr)
Inventor
王昊
杨明川
刘振华
李伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd Technology Innovation Center
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd Technology Innovation Center
China Telecom Corp Ltd
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 China Telecom Corp Ltd Technology Innovation Center, China Telecom Corp Ltd filed Critical China Telecom Corp Ltd Technology Innovation Center
Publication of WO2025010945A1 publication Critical patent/WO2025010945A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/254Fusion techniques of classification results, e.g. of results related to same input data
    • G06F18/256Fusion techniques of classification results, e.g. of results related to same input data of results relating to different input data, e.g. multimodal recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/809Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data
    • G06V10/811Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data the classifiers operating on different input data, e.g. multi-modal recognition

Definitions

  • the present disclosure relates to the technical field of machine learning, and in particular to a method and device for training a visual question answering model, a method and device for processing a visual question answering task, a computer-readable storage medium, and an electronic device.
  • Visual question answering models have made great progress in the field of multimodal learning, but current visual question answering methods require accurate data labels to build a complete dataset.
  • the purpose of the present disclosure is to provide a training method for a visual question answering model, a training device for a visual question answering model, a visual question answering task processing method, a visual question answering task processing device, a computer-readable medium and an electronic device, thereby improving the processing accuracy of the visual question answering model at least to a certain extent.
  • a training method for a visual question answering model including: obtaining initial training data, the initial training data including graphic input data and true answers corresponding to the graphic input data, wherein the graphic input data includes image feature data and text feature data; inputting the graphic input data into a first initial model to obtain a first reference answer; based on the first reference answer and the true answer, screening the initial training data to obtain first target training data; using the first reference answer of the first target training data and the corresponding true answer to update a second initial model to obtain a visual question answering model; wherein the model architecture of the first initial model and the second initial model are consistent.
  • a training device for a visual question-answering model comprising: a data acquisition module, used to acquire initial training data, the initial training data comprising graphic input data and true-value answers corresponding to the graphic input data, wherein the graphic input data comprises image feature data and text feature data; a data processing module, used to input the graphic input data into a first initial model to obtain a first reference answer; a data screening module, used to screen the initial training data based on the first reference answer and the true-value answer to obtain first target training data; a model updating module, used to update the second initial model using the first reference answer of the first target training data and the corresponding true-value answer to obtain a visual question-answering model; wherein the model architecture of the first initial model and the second initial model are consistent.
  • a method for processing a visual question answering task comprising: obtaining reference image features and corresponding reference text features corresponding to an image to be asked a question; inputting the reference image features and the reference text features into a visual question answering model to obtain a target answer; wherein the visual question answering model can be obtained according to a training method for the visual question answering model.
  • a visual question answering task processing device including: a feature acquisition module, used to obtain reference image features and corresponding reference text features corresponding to an image to be asked a question; a task processing module, used to input the reference image features and reference text features into a visual question answering model to obtain a target answer; wherein the visual question answering model is obtained according to a training method of the visual question answering model.
  • a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.
  • an electronic device characterized in that it includes: one or more processors; and a memory for storing one or more programs, which enables the one or more processors to implement the above method when the one or more programs are executed by the one or more processors.
  • An embodiment of the present disclosure provides a training method for a visual question answering model.
  • the first target training data is obtained by screening the initial training data through a first initial model, thereby improving the accuracy of the training data of the visual question answering model and making the obtained visual question answering model more accurate.
  • the visual question answering model is obtained by updating the parameters of the second initial model through the first reference answer output by the first initial model, thereby further improving the anti-noise ability of the obtained visual question answering model and improving the accuracy of the visual question answering model.
  • FIG1 is a schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
  • FIG2 schematically shows a flow chart of a method for training a visual question answering model in an exemplary embodiment of the present disclosure
  • FIG3 schematically shows a visual question answering model architecture diagram in an exemplary embodiment of the present disclosure
  • FIG4 schematically shows a partition diagram of an initial sub-model in an exemplary embodiment of the present disclosure
  • FIG5 schematically shows a flow chart of another method for training a visual question answering model in an exemplary embodiment of the present disclosure
  • FIG6 schematically shows a data flow diagram of a training method for a visual question answering model in an exemplary embodiment of the present disclosure
  • FIG7 schematically shows a flow chart of a method for processing a visual question answering task in an exemplary embodiment of the present disclosure
  • FIG8 schematically shows a data flow diagram of a method for processing a visual question answering task in an exemplary embodiment of the present disclosure
  • FIG9 schematically shows a composition diagram of a visual question answering task processing device in an exemplary embodiment of the present disclosure
  • FIG10 schematically shows a schematic diagram of the composition of a training device for a visual question answering model in an exemplary embodiment of the present disclosure
  • FIG. 11 is a schematic diagram showing an electronic device to which an embodiment of the present disclosure can be applied.
  • Visual question answering is a practical machine learning task that requires an AI model to output an answer to a visual question about an image.
  • the challenge of this task lies in its multi-task and open nature, which involves solving multiple technical research problems in computer vision and natural language understanding at the same time.
  • Progress in this task will enable multimodal machine learning to have a wide range of applications, from helping the blind and visually impaired, or communicating with robots, to enhancing the user's visual experience with external knowledge.
  • FIG1 shows a schematic diagram of a system architecture that can implement the training method for the visual question answering model.
  • the system architecture 100 may include a terminal 110 and a server.
  • the terminal 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, etc.
  • the server 120 generally refers to a background system that provides visual question answering related services in this exemplary embodiment, and may be a server or a cluster formed by multiple servers.
  • the terminal 110 and the server 120 may be connected via a wired or wireless communication link to exchange data.
  • the training method of the above-mentioned visual question answering model can be executed by the terminal 110.
  • the user uses the terminal 110 to obtain initial training data, and the initial training data includes graphic input data and the true value answer corresponding to the graphic input data, wherein the graphic input data includes image feature data and text feature data, and the terminal 110 first inputs the graphic input data into the first initial model to obtain the first reference answer, and then screens the initial training data based on the first reference answer and the true value answer to obtain the first target training data, and finally uses the first reference answer of the first target training data and the corresponding true value answer to update the second initial model to obtain the visual question answering model; wherein the model architecture of the first initial model and the second initial model is consistent.
  • the training method of the above-mentioned visual question answering model can be performed by the server 120.
  • the user uses the terminal 110 to obtain initial training data, and the initial training data includes graphic input data and the true value answer corresponding to the graphic input data, wherein the graphic input data includes image feature data and text feature data, and then the terminal 110 uploads the initial training data to the server 120, and the server 120 first inputs the graphic input data into the first initial model to obtain the first reference answer, and then screens the initial training data based on the first reference answer and the true value answer to obtain the first target training data, and finally uses the first reference answer of the first target training data and the corresponding true value answer to update the second initial model to obtain the visual question answering model, and then returns the visual question answering model to the terminal 110.
  • the execution entity of the training method of the visual question answering model in this exemplary embodiment can be the above-mentioned terminal 110 or server 120, and the present disclosure does not limit this.
  • Figure 2 shows an exemplary process of the training method of the visual question answering model, which may include steps S210 to S240.
  • initial training data is acquired, the initial training data including graphic and text input data and true value answers corresponding to the graphic and text input data, wherein the graphic and text input data includes image feature data and text feature data.
  • the processor may first acquire initial training data, wherein the initial training data includes graphic input data and true value answers corresponding to the graphic input data, wherein the graphic input data may include image feature data and text feature data.
  • the processor may first obtain an initial image, an initial text question, and a true answer corresponding to the initial text question, and then may perform feature extraction on the initial image and initial text question to obtain image feature data and text feature data.
  • Faster-RCNN (Regions with CNN features) can be used to extract features from the initial image to obtain image feature data.
  • Faster-RCNN is used to implement a bottom-up attention model, and the overlap of interest boxes is allowed by setting a threshold to more effectively understand the image content and obtain more accurate image feature data.
  • a text feature extraction model may be used to extract features from the initial question text, wherein the text feature extraction model may include two LSTMs (Long Short-Term Memory), including a top-down attention mechanism LSTM, which can help reweight image features.
  • LSTMs Long Short-Term Memory
  • LSTM top-down attention mechanism
  • GRU Gate Recurrent Unit
  • step S220 the graphic input data is input into the first initial model to obtain a first reference answer.
  • the above-mentioned graphic and text input data can be input into the above-mentioned first initial model to obtain the above-mentioned first reference answer.
  • the framework structure of the first initial model and the second initial model is the same, and the model parameters in the first initial model and the second initial model may be the same or different.
  • the parameters in the first initial model and the second initial model are different, so that the second initial model can absorb the anti-noise ability of the first initial model during training, so that the trained visual question answering model has higher accuracy.
  • the above-mentioned first initial model and the second initial model may include a top-down attention LSTM module 310, an attendance module 320, a language LSTM module 330 and a loss function layer 340.
  • the input of the t-th time step of the top-down attention LSTM module is:
  • LSTM module is the output of the previous round of the language LSTM module, is the average value of the image feature data, We is the embedding matrix of the question and answer text, ⁇ t is the one-hot encoded word of the current round input, and the top-down attention LSTM module provides the text information of the current language model, image belief and summary, and one-head description information.
  • each feature data can be assigned a weight
  • the probability distribution is calculated through a bottom-up LSTM network.
  • the image weighted features and The inputs that make up the language LSTM module are:
  • the probability distribution of the predicted word (i.e., the reference answer) at time t is:
  • the loss functions of the first initial model and the second initial model are:
  • yi represents the label of sample i
  • the positive class is 1
  • the negative class is 0.
  • pi represents the probability that sample i is predicted to be a positive class.
  • step S230 the initial training data is screened based on the first reference answer and the true value answer to obtain the first target training data.
  • the above method may include step S310 and step S330.
  • step S310 the loss value between the first reference answer and the true value answer is calculated.
  • the loss function determined above can be used to determine the loss value between the first reference answer and the true answer, or the similarity between the first reference answer and the true answer can be first determined, and the loss value can be obtained by subtracting the similarity from 1.
  • the calculation of the loss value can also be customized according to user needs, which is not specifically limited in this example implementation.
  • step S320 the initial training data corresponding to the first reference answer whose loss value is less than a preset threshold is used as the first target training data.
  • a preset threshold can be determined.
  • the preset threshold can be 0.2, 0.3, etc., and can also be customized according to user needs. Then, the above loss values are compared with the preset thresholds respectively, and the initial training data corresponding to the first reference answer whose loss value is less than the preset threshold is used as the above first target training data.
  • Using the loss value to filter the initial training data to obtain the first target data can reduce noise during training, improve the accuracy of the first target training data, and make the processing accuracy of the trained visual question answering model higher.
  • step S410 when acquiring the first target training data, step S410 may also be included. Go to step S430.
  • step S410 the initial training data is divided into a plurality of groups of initial sub-data
  • the initial training data may be first divided into multiple groups of initial sub-data, wherein the number of image feature data and text feature data in each group of initial sub-data may be one or more, such as 3, 5, etc., and the number of initial training data in each initial sub-data may be the same or different, which is not specifically limited in this example implementation.
  • step S420 each initial sub-data is screened based on the first reference answer and the true value answer to obtain the target sub-data;
  • the above-mentioned first reference answer and the above-mentioned true value answer are used to screen each initial sub-data to obtain multiple target sub-data.
  • the specific screening process can refer to steps S310 to S320, and is not specifically limited in this example implementation.
  • step S430 multiple groups of target sub-data are used as first target training data.
  • the multiple target sub-data can be used as the above-mentioned first target training data, and the initial training data can be divided into multiple groups for screening. Multiple groups can be screened at the same time, and the screening rate can be increased or decreased. At the same time, when the processor is busy, each initial sub-data can be screened in turn to reduce the processing pressure of the processor, and the screening of the above-mentioned initial training data can be completed under narrow bandwidth.
  • step S240 the second initial model is updated using the first reference answer of the first target training data and the corresponding true value answer to obtain a visual question answering model.
  • the first reference answer in the target initial training data and the true answer corresponding to the first reference answer can be used to update the second initial model to obtain the above-mentioned visual question answering model.
  • the first gradient value of back propagation can be determined based on the first reference answer in the above-mentioned first target training data and the true answer corresponding to the first reference answer, and then the calculated first gradient value is used to update the parameters in the second initial model to obtain the visual question answering model.
  • the training method of the visual question answering model may further include steps S250 to S270 .
  • step S250 the graphic input data is input into the second initial model to obtain a second reference answer.
  • the above-mentioned graphic and text input data can be input into the above-mentioned second initial model to obtain the above-mentioned second reference answer.
  • the framework structure of the first initial model and the second initial model is the same, and the model parameters in the first initial model and the second initial model may be the same or different.
  • the parameters in the first initial model and the second initial model are different, so that the second initial model can absorb the anti-noise ability of the first initial model during training, so that the trained visual question answering model has higher accuracy.
  • step S260 the initial training data is screened based on the second reference answer and the true value answer to obtain the second target training data.
  • the above method may include step S510 and step S530.
  • step S510 the loss value between the second reference answer and the true answer is calculated.
  • the loss function determined above can be used to determine the loss value between the second reference answer and the true answer, or the similarity between the second reference answer and the true answer can be first determined, and the loss value can be obtained by subtracting the similarity from 1.
  • the calculation of the loss value can also be customized according to user needs, which is not specifically limited in this example implementation.
  • step S520 the initial training data corresponding to the second reference answer whose loss value is less than a preset threshold is used as the second target training data.
  • a preset threshold can be determined.
  • the preset threshold can be 0.2, 0.3, etc., and can also be customized according to user needs. Then, the above loss values are compared with the preset thresholds respectively, and the loss values are The initial training data corresponding to the second reference answer that is smaller than the preset threshold is used as the second target training data.
  • Using the loss value to filter the initial training data to obtain the second target data can reduce the noise during training, improve the accuracy of the second target training data, and make the processing accuracy of the trained visual question answering model higher.
  • steps S610 to S630 may also be included.
  • step S610 the initial training data is divided into a plurality of groups of initial sub-data
  • the initial training data may be first divided into a plurality of groups of initial sub-data, wherein the number of image feature data and text feature data in each group of initial sub-data may be one or more, such as 3, 5, etc., and the number of initial training data in each initial sub-data may be the same or different, which is not specifically limited in this example implementation.
  • step S620 each initial sub-data is screened based on the second reference answer and the true value answer to obtain the target sub-data;
  • the second reference answer and the true value answer are used to filter each initial sub-data to obtain multiple target sub-data.
  • the specific filtering process can refer to steps S510 to S520, which is not specifically limited in this example implementation.
  • step S630 multiple groups of target sub-data are used as second target training data.
  • the multiple target sub-data can be used as the above-mentioned second target training data, and the initial training data can be divided into multiple groups for screening. Multiple groups can be screened at the same time, and the screening rate can be increased or decreased. At the same time, when the processor is busy, each initial sub-data can be screened in turn to reduce the processing pressure of the processor, and the screening of the above-mentioned initial training data can be completed under narrow bandwidth.
  • step S270 the first initial model is updated using the second reference answer of the second target training data and the corresponding true answer to obtain a visual question answering model.
  • the second reference answer in the second target training data and the true answer corresponding to the second reference answer can be used to update the second initial model to obtain the visual question answering model.
  • the second gradient value of back propagation can be determined based on the second reference answer in the second target training data and the true answer corresponding to the second reference answer, and then the calculated second gradient value is used to update the parameters in the first initial model to obtain the visual question answering model.
  • the output and true value answer of the first initial model can be used to update the second initial model
  • the output and true value answer of the second initial model can be used to update the first initial model to obtain two visual question answering models, and any one of the visual question answering models can complete the visual question answering task.
  • the initial sub-data includes three initial training data, and the initial sub-data can be sent to the first initial model.
  • the loss values of the three initial training data are calculated respectively to select two first target sub-data, the gradient value of the back propagation corresponding to the first target sub-data is calculated, and the gradient value is used to train the second initial model.
  • the initial sub-data can be sent to the second initial model.
  • the loss values of the three initial training data are calculated respectively to select two second target sub-data, the gradient value of the back propagation corresponding to the second target sub-data is calculated, and the gradient value is used to train the first initial model.
  • the first target training data is obtained by screening the initial training data through the first initial model, which improves the accuracy of the initial training data and makes the obtained visual question answering model more accurate;
  • the visual question answering model is obtained by updating the parameters of the second initial model through the first reference answer output by the first initial model, which further improves the anti-noise ability of the obtained visual question answering model and improves the accuracy of the visual question answering model.
  • using the loss value to screen the initial training data and obtain the first target data can reduce the noise during training, improve the accuracy of the first target training data, and make the processing accuracy of the trained visual question answering model higher.
  • the initial training data is divided into multiple groups for screening, and multiple groups can be screened at the same time, which can increase or decrease The screening rate can be increased.
  • each initial sub-data can be screened in turn to reduce the processing pressure of the processor, and the screening of the above initial training data can be completed under narrow bandwidth.
  • the present disclosure also provides a method for processing a visual question answering task, which can be executed by the terminal in FIG. 1 or by the server in FIG. 1 .
  • a user uses terminal 110 to obtain reference image features and reference text features corresponding to the image to be asked a question, and loads a visual question answering model at the same time, wherein the visual question answering model is trained by the training method of the visual model. Then, the reference image features and reference text features are input into the visual question answering model to obtain the target answer, so as to complete the processing of the visual question answering task.
  • the reference image features and the corresponding reference text features corresponding to the image to be asked a question are uploaded to server 120, and server 120 loads the visual question answering model, where the visual question answering model is trained by the above-mentioned visual model training method, and then uses the visual question answering model to process the reference image features and the corresponding reference text features corresponding to the above-mentioned image to be asked a question to obtain the target answer.
  • the visual question answering task processing method may specifically include steps S710 to S720.
  • step S710 reference image features and corresponding reference text features corresponding to the image to be queried are obtained.
  • the image to be asked can be input into an image feature extraction module to obtain reference image features
  • the question can be input into a text feature extraction module to obtain reference text features.
  • image feature extraction and text feature extraction can refer to the training method of the visual question answering model, which will not be repeated here.
  • step S720 the reference image features and the reference text features are input into the visual question answering model to obtain the target answer.
  • the reference image features and reference text features may be input into the above-mentioned visual question answering model to obtain the target answer.
  • the specific structure of the visual question answering model can be referred to the training method of the visual question answering model, which will not be repeated here.
  • the embodiment of this example also provides a training device 900 for a visual question answering model, including a data acquisition module 910, a data processing module 920, a data screening module 930 and a model updating module 940. Among them:
  • the data acquisition module 910 can be used to acquire initial training data, which includes graphic input data and the true value answer corresponding to the graphic input data, wherein the graphic input data includes image feature data and text feature data; the data processing module 920 can be used to input the graphic input data into the first initial model to obtain the first reference answer; the data screening module 930 can be used to screen the initial training data based on the first reference answer and the true value answer to obtain the first target training data; the model updating module 940 can be used to update the second initial model with the first reference answer of the first target training data and the corresponding true value answer to obtain the visual question answering model.
  • the model architecture of the first initial model and the second initial model is consistent.
  • the data acquisition module 910 may be configured to acquire an initial image, an initial question text, and a true answer corresponding to the initial question text; and perform feature extraction on the initial image and the initial question text to obtain image feature data and text feature data.
  • the data screening module 930 may be configured to calculate a loss value between a first reference answer and a true value answer; and use initial training data corresponding to the first reference answer whose loss value is less than a preset threshold as first target training data.
  • the data screening module 930 may be configured to divide the initial training data into multiple groups of initial sub-data; screen each initial sub-data based on a first reference answer and a true value answer to obtain target sub-data; and use the multiple groups of target sub-data as first target training data.
  • the model updating module 940 may be configured to update the second initial model using the second reference answer and the corresponding true value answer in each target sub-data to obtain a visual question answering model.
  • the embodiment of this example also provides a visual question answering task processing device 1000, including a feature acquisition module 1010 and a task processing module 1020. Among them:
  • the feature acquisition module 1010 can be used to obtain the reference image features and the corresponding reference text features corresponding to the image to be questioned; the task processing module 1020 can be used to input the reference image features and the reference text features into the visual question answering model to obtain the target answer; wherein the visual question answering model is obtained according to the training method of the visual question answering model according to any one of claims 1-6.
  • the exemplary embodiment of the present disclosure also provides an electronic device for executing the training method of the visual question answering model, and the electronic device may be the terminal 110 or the server 120.
  • the electronic device may include a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the training method of the visual question answering model by executing the executable instructions.
  • the mobile terminal 1100 may specifically include: a processor 1101, a memory 1102, a bus 1103, a mobile communication module 1104, an antenna 1, a wireless communication module 1105, an antenna 2, a display screen 1106, a camera module 1107, an audio module 1108, a power module 1109 and a sensor module 1110.
  • Processor 1101 may include one or more processing units, for example: processor 1101 may include AP (Application Processor), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, encoder, decoder, DSP (Digital Signal Processor), baseband processor and/or NPU (Neural-Network Processing Unit), etc.
  • the training method of the visual question answering model in this exemplary embodiment may be executed by AP, GPU or DSP, and when the method involves neural network-related processing, it may be executed by NPU.
  • the processor 1101 may be connected to the memory 1102 or other components via a bus 1103 .
  • the memory 1102 may be used to store computer executable program codes, which may include instructions.
  • the processor 1101 executes various functional applications and data processing of the mobile terminal 1100 by running the instructions stored in the memory 1102.
  • the memory 1102 may also store application data, such as images, videos, and other files.
  • the communication function of the mobile terminal 1100 can be implemented by the mobile communication module 1104, antenna 1, wireless communication module 1105, antenna 2, modem processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the mobile communication module 1104 can provide 2G, 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1100.
  • the wireless communication module 1105 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1100.
  • the display screen 1106 is used to implement display functions, such as displaying user interfaces, images, videos, etc.
  • the camera module 1107 is used to implement shooting functions, such as shooting images, videos, etc.
  • the audio module 208 is used to implement audio functions, such as playing audio, collecting voice, etc.
  • the power module 209 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc.
  • the sensor module 1110 may include a depth sensor 11101, a pressure sensor 11102, a gyroscope sensor 11103, an air pressure sensor 11104, etc., to implement corresponding sensing detection functions.
  • the exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored.
  • various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.
  • the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
  • the program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages.
  • the program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
  • the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • Internet service provider e.g., AT&T, MCI, Sprint, EarthLink, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Mathematical Physics (AREA)
  • Electrically Operated Instructional Devices (AREA)

Abstract

本发明涉及机器学习技术领域,涉及一种视觉问答模型的训练方法及装置、视觉问答任务处理方法及装置、计算机可读存储介质及电子设备,视觉问答模型的训练方法包括:获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据;将图文输入数据输入至第一初始模型得到第一参考答案;基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据;利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型;其中,第一初始模型和第二初始模型的模型架构一致。本发明的技术方案提高了得到视觉问答模型的处理精度。

Description

视觉问答模型的训练、视觉问答任务处理方法及装置
相关申请的交叉引用
本申请要求于2023年07月07日提交的,申请号为202310833232.4,名称为“视觉问答模型的训练、视觉问答任务处理方法及装置”的中国专利申请的优先权,该中国专利申请的全部内容通过引用结合在本文中。
技术领域
本公开涉及机器学习技术领域,具体而言,涉及一种视觉问答模型的训练方法及装置、视觉问答任务处理方法及装置、计算机可读存储介质及电子设备。
背景技术
视觉问答模型在多模态学习领域有了长足发展,但目前的视觉问答方法都需要准确的数据标签才能构建完善的数据集。
然而,构建视觉问答模型标注数据集需要极大的人力和时间成本,且标注的数据也不可避免地存在着噪声,导致训练得到的视觉问答模型的处理精度较低。
发明内容
本公开的目的在于提供一种视觉问答模型的训练方法、视觉问答模型的训练装置、视觉问答任务处理方法、视觉问答任务处理装置、计算机可读介质和电子设备,进而至少在一定程度上提高了得到视觉问答模型的处理精度。
根据本公开的第一方面,提供一种视觉问答模型的训练方法,包括:获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据;将图文输入数据输入至第一初始模型得到第一参考答案;基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据;利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型;其中,第一初始模型和第二初始模型的模型架构一致。
根据本公开的第二方面,提供一种视觉问答模型的训练装置,包括:数据获取模块,用于获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据;数据处理模块,用于将图文输入数据输入至第一初始模型得到第一参考答案;数据筛选模块,用于基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据;模型更新模块,利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型;其中,第一初始模型和第二初始模型的模型架构一致。
根据本公开的第三方面,提供一种视觉问答任务处理方法,包括:获取待提问图像对应的参考图像特征以及对应的参考文本特征;将参考图像特征和参考文本特征输入至视觉问答模型得到目标答案;其中,视觉问答模型可以根据视觉问答模型的训练方法得到。
根据本公开的第四方面,提供一种视觉问答任务处理装置,包括:特征获取模块,用于获取待提问图像对应的参考图像特征以及对应的参考文本特征;任务处理模块,用于将参考图像特征和参考文本特征输入至视觉问答模型得到目标答案;其中,视觉问答模型是根据视觉问答模型的训练方法得到。
根据本公开的第五方面,提供一种计算机可读介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述的方法。
根据本公开的第六方面,提供一种电子设备,其特征在于,包括:一个或多个处理器;以及存储器,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现上述的方法。
本公开的一种实施例所提供的视觉问答模型的训练方法,一方面,通过第一初始模型对初始训练数据进行筛选得到第一目标训练数据,提升了视觉问答模型的训练数据的精度,使得得到的视觉问答模型的精度更高;另一方面,通过第一初始模型的输出的第一参考答案来更新第二初始模型的参数得到视觉问答模型,进一步提升了得到的视觉问答模型的抗噪声能力,提升了视觉问答模型的精度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:
图1示出了可以应用本公开实施例的一种示例性系统架构的示意图;
图2示意性示出本公开示例性实施例中一种视觉问答模型的训练方法的流程图;
图3示意性示出本公开示例性实施例中一种视觉问答模型架构图;
图4示意性示出本公开示例性实施例中一种初始子模型的划分图;
图5示意性示出本公开示例性实施例中另一种视觉问答模型的训练方法的流程图;
图6示意性示出本公开示例性实施例中一种视觉问答模型的训练方法的数据流向图;
图7示意性示出本公开示例性实施例中一种视觉问答任务处理方法的流程图;
图8示意性示出本公开示例性实施例中一种视觉问答任务处理方法的数据流向图;
图9示意性示出本公开示例性实施例中视觉问答任务处理装置的组成示意图;
图10示意性示出本公开示例性实施例中视觉问答模型的训练装置的组成示意图;
图11示出了可以应用本公开实施例的一种电子设备的示意图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
视觉问答是一个实用的机器学习任务,该任务需要一个AI模型来输出一个关于图像的视觉问题的答案。该任务的挑战性在于其多任务性和开放性,它涉及同时解决计算机视觉和自然语言理解中的多个技术研究问题。这项任务的进展将使多模态机器学习进行广泛的应用,从帮助盲人和视障人士,或与机器人交流,以增强用户的视觉体验与外部知识。
现有的视觉问答系统存在以下问题:如果没有高质量的视觉图片、问题和回答且多样化的三元组大规模初始训练数据,就较难训练出有效且表现稳定的视觉问答模型。
但是,制备完善的数据集既耗时又繁重。目前视觉问答研究领域主要关注复杂模型的设计,而非真实场景中所需要的训俩数据构建。因此,如何使模型在较低质量的标注下进行鲁棒的训练是目前亟需解决的问题。
基于上述缺点,本公开提供一种视觉问答模型的训练方法,图1示出了可以实现上述视觉问答模型的训练方法的系统架构的示意图,该系统架构100可以包括终端110与服务 器120。其中,终端110可以是智能手机、平板电脑、台式电脑、笔记本电脑等终端设备,服务器120泛指提供本示例性实施方式中视觉问答相关服务的后台系统,可以是一台服务器或多台服务器形成的集群。终端110与服务器120之间可以通过有线或无线的通信链路形成连接,以进行数据交互。
在一种实施方式中,可以由终端110执行上述视觉问答模型的训练方法。例如,用户使用终端110获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据,由终端110首先将图文输入数据输入至第一初始模型得到第一参考答案,然后基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据,最后利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型;其中,第一初始模型和第二初始模型的模型架构一致。
在一种实施方式中,可以由服务器120可以执行上述视觉问答模型的训练方法。例如,用户使用终端110获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据后,终端110将该初始训练数据上传至服务器120,由服务器120对首先将图文输入数据输入至第一初始模型得到第一参考答案,然后基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据,最后利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型,然后向终端110返回视觉问答模型。
由上可知,本示例性实施方式中的视觉问答模型的训练方法的执行主体可以是上述终端110或服务器120,本公开对此不做限定。
下面结合图2对本示例性实施方式中的视觉问答模型的训练方法进行说明,图2示出了该视觉问答模型的训练方法的示例性流程,可以包括步骤S210至步骤S240。
参考图2,在步骤S210中,获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据。
在本公开的一种示例实施方式中,处理器可以首先获取初始训练数据,其中,上述初始训练数据中包括图文输入数据和图文输入数据对应的真值答案,其中,上述图文输入数据可以包括图像特征数据和文本特征数据。
具体的,处理器可以首先获取初始图像、初始文本问题以及初始文本问题对应的真值答案,然后可以对上述初始图像和初始文本问题进行特征提取得到图像特征数据和文本特征数据。
在一种示例实施方式中,可以使用Faster-RCNN(Regions with CNN features,区域生成网络)来对初始图像进行特征提取得到图像特征数据。在本示例实施方式中,使用Faster-RCNN实现自下向上的关注模型,通过设定的阈值允许兴趣框的重叠能够更有效的理解图像内容,得到更加精确的图像特征数据。
在一种示例实施方式中,可以采用文本特征提取模型来实现对初始问题文本的特征提取,其中,文本特征提取模型可以包括两个LSTM(Long Short-Term Memory,长短期记忆网络),其中包括一个自顶向下注意力机制的LSTM,其可以帮助图像特征进行重加权。提取特征后要使用GRU(Gated Recurrent Unit,门控循环单元)模块做序列编码处理。
在步骤S220中,将图文输入数据输入至第一初始模型得到第一参考答案。
在本公开的一种示例实施方式中,在得到上述图文输入数据之后,可以将上述图文输入数据输入至上述第一初始模型中得到上述第一参考答案。
第一初始模型和第二初始模型的框架结构相同,第一初始模型和第二初始模型中的模型参数可以相同也可以不同,优选的,上述第一初始模型与第二初始模型中的参数不相同,在训练时能够使得第二初始模型吸收第一初始模型的抗噪声能力,使得训练得到的视觉问答模型的精度更高。
在本示例实施方式中,上述第一初始模型和第二初始模型可以是UpDn和GRU的模型结构,初始训练数据为D={Ii,Qi,ai}N,其包含N个图像Ii,问题Qi,回答ai对。
具体的,参照图3所示,上述第一初始模型和第二初始模型可以包括top-down attention(自顶向下的注意)LSTM模块310,attend(加权)模块320、language(语言)LSTM模块330以及损失函数层340。
具体的,top-down attention(自顶向下的注意)LSTM模块的第t个时间步长的输入为:
其中,为language(语言)LSTM模块上一轮的输出,为图像特征数据的平均值,We是问答文本的embedding矩阵,∏t是当前轮输入的one-hot编码的词,分别为top-down attention(自顶向下的注意)LSTM模块提供了当前语言模型的文本信息、图像相信和概要和一头的描述信息。
进一步的可以对每个特征数据赋予权重
并通过一个softmax函数,得到:at=softmax(at)
最终获得图像加权特征:
另一方面,通过自底向上的LSTM网络来计算概率分布,具体的,将图像加权特征和组成language(语言)LSTM模块的输入:
这时,t时刻的预测词(即参考答案)的概率分布为:
其中上述第一初始模型和第二初始模型的损失函数为:
其中,yi表示样本i的标签,正类为1,负类为0。pi表示样本i预测为正类的概率。
需要说明的是,上述关于第一初始模型和第二初始模型的具体框架的说明是示例性的,在本公开中不对第一初始模型和第二初始模型的具体架构做详细限定。
在步骤S230中,基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据。
在本示例实施方式中,上述方法可以包括步骤S310和步骤S330。
在步骤S310中,计算第一参考答案与真值答案的损失值。
在本示例实施方式中,可以采用上述确定的损失函数开确定上述第一参考答案与真值答案的损失值,也可以首先确定上述第一参考答案与真值答案之间的相似度,利用1减去上述相似度得到上述损失值,损失值的计算还可以根据用户需求进行自定义,在本示例实施方式中不做具体限定。
在步骤S320中,将损失值小于预设阈值的第一参考答案对应的初始训练数据作为第一目标训练数据。
在得到各第一参考对应损失值之后,可以确定预设阈值,预设阈值可以是0.2、0.3等,还可以根据用户需求进行自定义,然后将上述损失值分别与预设阈值进行比较,将损失值小于预设阈值的第一参考答案对应的初始训练数据作为上述第一目标训练数据。
利用损失值对初始训练数据及进行筛选得到第一目标数据,能够降低训练时的噪声,提升了第一目标训练数据的精度,能够使得训练得到的视觉问答模型的处理精度更高。
在本公开的一种示例实施方式中,获取第一目标训练数据时,还可以包括步骤S410 至步骤S430。
在步骤S410中,将初始训练数据划分为多组初始子数据;
在本示例实施方式中,参照图4所示,可以首先将上述初始训练数据划分为多组初始子数据,其中,每组初始子数据中的图像特征数据与文本特征数据的数量可以一个,也可以是多个,如、3个、5个等,各初始子数据中的初始训练数据的数量可以相同也可以不同,在本示例实施方式中不做具体限定。
在步骤S420中,基于第一参考答案和真值答案对各初始子数据进行筛选得到目标子数据;
在完成分组之后,利用上述第一参考答案和上述真值答案分别对各初始子数据进行筛选得到多个目标子数据,具体的筛选过程可以参考步骤S310至步骤S320,在本示例实施方式中不做具体限定。
在步骤S430中,将多组目标子数据作为第一目标训练数据。
在得到多个目标子数据之后,可以将多个目标子数据作为上述第一目标训练数据,将初始训练数据划分为多组进行筛选,可以多组同时进行筛选,能够增减筛选速率,同时,可以在处理器繁忙时,依次对各初始子数据进行筛选能够降低处理器的处理压力,可以在窄带宽的情况下完成对上述初始训练数据进行筛选。
在步骤S240中,利用第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型。
在本示例实施方式中,在得到上述第一目标训练数据之后,可以利用目标初始训练数据中第一参考答案和第一参考答案对应的真值答案更新第二初始模型得到上述视觉问答模型。
具体的,可以基于上述第一目标训练数据中的第一参考答案和第一参考答案对应的真值答案确定反向传播的第一梯度值,然后利用计算得到的第一梯度值更新第二初始模型中的参数得到视觉问答模型。
在本公开的一种示例实施方式中,参照图5所示,上述视觉问答模型的训练方法还可以包括步骤S250至步骤S270。
在步骤S250中,将图文输入数据输入至第二初始模型得到第二参考答案。
在本公开的一种示例实施方式中,在得到上述图文输入数据之后,可以将上述图文输入数据输入至上述第二初始模型中得到上述第二参考答案。
第一初始模型和第二初始模型的框架结构相同,第一初始模型和第二初始模型中的模型参数可以相同也可以不同,优选的,上述第一初始模型与第二初始模型中的参数不相同,在训练时能够使得第二初始模型吸收第一初始模型的抗噪声能力,使得训练得到的视觉问答模型的精度更高。
在步骤S260中,基于第二参考答案和真值答案对初始训练数据进行筛选得到第二目标训练数据。
在本示例实施方式中,上述方法可以包括步骤S510和步骤S530。
在步骤S510中,计算第二参考答案与真值答案的损失值。
在本示例实施方式中,可以采用上述确定的损失函数开确定上述第二参考答案与真值答案的损失值,也可以首先确定上述第二参考答案与真值答案之间的相似度,利用1减去上述相似度得到上述损失值,损失值的计算还可以根据用户需求进行自定义,在本示例实施方式中不做具体限定。
在步骤S520中,将损失值小于预设阈值的第二参考答案对应的初始训练数据作为第二目标训练数据。
在得到各第二参考对应损失值之后,可以确定预设阈值,预设阈值可以是0.2、0.3等,还可以根据用户需求进行自定义,然后将上述损失值分别与预设阈值进行比较,将损失值 小于预设阈值的第二参考答案对应的初始训练数据作为上述第二目标训练数据。
利用损失值对初始训练数据及进行筛选得到第二目标数据,能够降低训练时的噪声,提升了第二目标训练数据的精度,能够使得训练得到的视觉问答模型的处理精度更高。
在本公开的一种示例实施方式中,获取第二目标训练数据时,还可以包括步骤S610至步骤S630。
在步骤S610中,将初始训练数据划分为多组初始子数据;
在本示例实施方式中,参照图5所示,可以首先将上述初始训练数据划分为多组初始子数据,其中,每组初始子数据中的图像特征数据与文本特征数据的数量可以一个,也可以是多个,如、3个、5个等,各初始子数据中的初始训练数据的数量可以相同也可以不同,在本示例实施方式中不做具体限定。
在步骤S620中,基于第二参考答案和真值答案对各初始子数据进行筛选得到目标子数据;
在完成分组之后,利用上述第二参考答案和上述真值答案分别对各初始子数据进行筛选得到多个目标子数据,具体的筛选过程可以参考步骤S510至步骤S520,在本示例实施方式中不做具体限定。
在步骤S630中,将多组目标子数据作为第二目标训练数据。
在得到多个目标子数据之后,可以将多个目标子数据作为上述第二目标训练数据,将初始训练数据划分为多组进行筛选,可以多组同时进行筛选,能够增减筛选速率,同时,可以在处理器繁忙时,依次对各初始子数据进行筛选能够降低处理器的处理压力,可以在窄带宽的情况下完成对上述初始训练数据进行筛选。
在步骤S270中,利用第二目标训练数据的第二参考答案以及对应的真值答案更新第一初始模型得到视觉问答模型。
在本示例实施方式中,在得到上述第二目标训练数据之后,可以利用第二目标训练数据中第二参考答案和第二参考答案对应的真值答案更新第二初始模型得到上述视觉问答模型。
具体的,可以基于上述第二目标训练数据中的第二参考答案和第二参考答案对应的真值答案确定反向传播的第二梯度值,然后利用计算得到的第二梯度值更新第一初始模型中的参数得到视觉问答模型。
在本示例实施方式中,参照图6所示,可以利用第一初始模型的输出和真值答案来对第二初始模型进行更新,利用第二初始模型的输出和真值答案对第一初始模型进行更新得到两个视觉问答模型,任意一视觉问答模型都可以完成视觉问答任务。
举例而言,初始子数据包括三个初始训练数据,可以将初始子数据送入第一初始模型。分别计算三个初始训练数据的损失值选出两个第一目标子数据,计算第一目标子数据对应的反向传播的梯度值,并利用该梯度值训练第二初始模型,同理,可以将初始子数据送入第二初始模型。分别计算三个初始训练数据的损失值选出两个第二目标子数据,计算第二目标子数据对应的反向传播的梯度值,并利用该梯度值训练第一初始模型。在将所有初始子数据完成训俩那之后得到两个视觉问答模型,两个视觉问答模型均可以较为精确的完成视觉问答任务。
综上,本示例性实施方式中,一方面,通过第一初始模型对初始训练数据进行筛选得到第一目标训练数据,提升了初始训练数据的精度,使得得到的视觉问答模型的精度更高;另一方面,通过第一初始模型的输出的第一参考答案来更新第二初始模型的参数得到视觉问答模型,进一步提升了得到的视觉问答模型的抗噪声能力,提升了视觉问答模型的精度。再一方面,利用损失值对初始训练数据及进行筛选得到第一目标数据,能够降低训练时的噪声,提升了第一目标训练数据的精度,能够使得训练得到的视觉问答模型的处理精度更高,又一方面,将初始训练数据划分为多组进行筛选,可以多组同时进行筛选,能够增减 筛选速率,同时,可以在处理器繁忙时,依次对各初始子数据进行筛选能够降低处理器的处理压力,可以在窄带宽的情况下完成对上述初始训练数据进行筛选。
进一步的,参照图7所示,本公开还提供一种视觉问答任务处理方法,该方法可以由图1中的上述终端执行,也可以由图1中的服务器执行,例如,用户使用终端110获取待提问图像对应的参考图像特征以及对应的参考文本特征,同时加载视觉问答模型,其中视觉问答模型是由上述视觉模型的训练方法训练得到的。然后将上述参考图像特征和参考文本特征输入至视觉问答模型得到目标答案,以完成对上述视觉问答任务的处理。
再例如,用户使用终端110获取待提问图像对应的参考图像特征以及对应的参考文本特征之后,将待提问图像对应的参考图像特征以及对应的参考文本特征上传至服务器120,由服务器120对加载视觉问答模型,其中视觉问答模型是由上述视觉模型的训练方法训练得到的,然后利用视觉问答模型对上述待提问图像对应的参考图像特征以及对应的参考文本特征进行处理得到目标答案。
视觉问答任务处理方法具体可以包括步骤S710至步骤S720。
在步骤S710中,获取待提问图像对应的参考图像特征以及对应的参考文本特征。
在本示例实施方式中,参照图8所示,在得到待提问图像和对应的问题之后,可以将待提问图像输入至图像特征提取模块得到参考图像特征,将问题输入至文本特征提取模块得到参考文本特征。
图像特征提取以及文本特征提取的具体流程可以参照视觉问答模型的训练方法,在此不再赘述。
在步骤S720中,将参考图像特征和参考文本特征输入至视觉问答模型得到目标答案。
在得到上述参考图像特征和参考文本特征之后,可以将参考图像特征和参考文本特征输入至上述视觉问答模型中得到目标答案。
视觉问答模型的具体结构可以参考视觉问答模型的训练方法在此不再赘述。
需要注意的是,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
进一步的,参考图9所示,本示例的实施方式中还提供一种视觉问答模型的训练装置900,包括数据获取模块910、数据处理模块920、数据筛选模块930和模型更新模块940。其中:
数据获取模块910可以用于获取初始训练数据,初始训练数据包括图文输入数据以及图文输入数据对应的真值答案,其中,图文输入数据包括图像特征数据和文本特征数据;数据处理模块920可以用于将图文输入数据输入至第一初始模型得到第一参考答案;数据筛选模块930可以用于基于第一参考答案和真值答案对初始训练数据进行筛选得到第一目标训练数据;模型更新模块940可以用于第一目标训练数据的第一参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型。其中,第一初始模型和第二初始模型的模型架构一致。
在一种示例实施方式中,数据获取模块910可以被配置为获取初始图像、初始问题文本以及初始问题文本对应的真值答案;多初始图像和初始问题文本进行特征提取得到图像特征数据和文本特征数据。
在一种示例实施方式中,数据筛选模块930可以被配置为计算第一参考答案与真值答案的损失值;将损失值小于预设阈值的第一参考答案对应的初始训练数据作为第一目标训练数据。
在另一种示例实施方式中,数据筛选模块930可以被配置为将初始训练数据划分为多组初始子数据;基于第一参考答案和真值答案对各初始子数据进行筛选得到目标子数据;将多组目标子数据作为第一目标训练数据。
在一种示例实施方式中,模型更新模块940可以被配置为分别利用各目标子数据中的第二参考答案以及对应的真值答案更新第二初始模型得到视觉问答模型。
进一步的,参考图10所示,本示例的实施方式中还提供一种视觉问答任务处理装置1000,包括特征获取模块1010和任务处理模块1020。其中:
特征获取模块1010可以用于获取待提问图像对应的参考图像特征以及对应的参考文本特征;任务处理模块1020可以用于将参考图像特征和参考文本特征输入至视觉问答模型得到目标答案;其中,视觉问答模型是根据权利要求1-6中任一项的视觉问答模型的训练方法得到。
上述装置中各模块的具体细节在方法部分实施方式中已经详细说明,未披露的细节内容可以参见方法部分的实施方式内容,因而不再赘述。
本公开的示例性实施方式还提供一种用于执行上述视觉问答模型的训练方法的电子设备,该电子设备可以是上述终端110或服务器120。一般的,该电子设备可以包括处理器与存储器,存储器用于存储处理器的可执行指令,处理器配置为经由执行可执行指令来执行上述视觉问答模型的训练方法。
下面以图11中的移动终端1100为例,对该电子设备的构造进行示例性说明。本领域技术人员应当理解,除了特别用于移动目的的部件之外,图11中的构造也能够应用于固定类型的设备。
如图11所示,移动终端1100具体可以包括:处理器1101、存储器1102、总线1103、移动通信模块1104、天线1、无线通信模块1105、天线2、显示屏1106、摄像模块1107、音频模块1108、电源模块1109与传感器模块1110。
处理器1101可以包括一个或多个处理单元,例如:处理器1101可以包括AP(Application Processor,应用处理器)、调制解调处理器、GPU(Graphics Processing Unit,图形处理器)、ISP(Image Signal Processor,图像信号处理器)、控制器、编码器、解码器、DSP(Digital Signal Processor,数字信号处理器)、基带处理器和/或NPU(Neural-Network Processing Unit,神经网络处理器)等。本示例性实施方式中的视觉问答模型的训练方法可以由AP、GPU或DSP来执行,当方法涉及到神经网络相关的处理时,可以由NPU来执行。
处理器1101可以通过总线1103与存储器1102或其他部件形成连接。
存储器1102可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器1101通过运行存储在存储器1102的指令,执行移动终端1100的各种功能应用以及数据处理。存储器1102还可以存储应用数据,例如存储图像,视频等文件。
移动终端1100的通信功能可以通过移动通信模块1104、天线1、无线通信模块1105、天线2、调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。移动通信模块1104可以提供应用在移动终端1100上2G、3G、4G、5G等移动通信解决方案。无线通信模块1105可以提供应用在移动终端1100上的无线局域网、蓝牙、近场通信等无线通信解决方案。
显示屏1106用于实现显示功能,如显示用户界面、图像、视频等。摄像模块1107用于实现拍摄功能,如拍摄图像、视频等。音频模块208用于实现音频功能,如播放音频,采集语音等。电源模块209用于实现电源管理功能,如为电池充电、为设备供电、监测电池状态等。传感器模块1110可以包括深度传感器11101、压力传感器11102、陀螺仪传感器11103、气压传感器11104等,以实现相应的感应检测功能。
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
本公开的示例性实施方式还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
此外,可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限定。

Claims (11)

  1. 一种视觉问答模型的训练方法,其特征在于,包括:
    获取初始训练数据,所述初始训练数据包括图文输入数据以及所述图文输入数据对应的真值答案,其中,所述图文输入数据包括图像特征数据和文本特征数据;
    将所述图文输入数据输入至第一初始模型得到第一参考答案;
    基于第一参考答案和所述真值答案对所述初始训练数据进行筛选得到第一目标训练数据;
    利用所述第一目标训练数据的第一参考答案以及对应的所述真值答案更新第二初始模型得到所述视觉问答模型;
    其中,所述第一初始模型和所述第二初始模型的模型架构一致。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    将所述图文输入数据输入至所述第二初始模型得到第二参考答案;
    基于第二参考答案和所述真值答案对所述初始训练数据进行筛选得到第二目标训练数据;
    利用所述第二目标训练数据的第二参考答案以及对应的所述真值答案更新所述第一初始模型得到所述视觉问答模型。
  3. 根据权利要求1所述的方法,其特征在于,所述基于第一参考答案和所述真值答案对所述初始训练数据进行筛选得到第一目标训练数据包括:
    计算所述第一参考答案与所述真值答案的损失值;
    将损失值小于预设阈值的第一参考答案对应的初始训练数据作为所述第一目标训练数据。
  4. 根据权利要求1所述的方法,其特征在于,所述基于第一参考答案和所述真值答案对所述初始训练数据进行筛选得到第一目标训练数据包括:
    将所述初始训练数据划分为多组初始子数据;
    基于所述第一参考答案和所述真值答案对各所述初始子数据进行筛选得到目标子数据;
    将多组所述目标子数据作为所述第一目标训练数据。
  5. 根据权利要求4所述的方法,其特征在于,所述利用所述第一目标训练数据的第一参考答案以及对应的所述真值答案更新第二初始模型得到所述视觉问答模型包括:
    分别利用各所述目标子数据中的第二参考答案以及对应的所述真值答案更新所述第二初始模型得到所述视觉问答模型。
  6. 根据权利要求1所述的方法,其特征在于,所述获取初始训练数据包括:
    获取初始图像、初始问题文本以及所述初始问题文本对应的真值答案;
    对所述初始图像和所述初始问题文本进行特征提取得到所述图像特征数据和文本特征数据。
  7. 一种视觉问答任务处理方法,其特征在于,包括:
    获取待提问图像对应的参考图像特征以及对应的参考文本特征;
    将所述参考图像特征和所述参考文本特征输入至视觉问答模型得到目标答案;
    其中,所述视觉问答模型可以根据权利要求1至6中任一项所述的视觉问答模型的训练方法得到。
  8. 一种视觉问答模型的训练装置,其特征在于,包括:
    数据获取模块,用于获取初始训练数据,所述初始训练数据包括图文输入数据以及所述图文输入数据对应的真值答案,其中,所述图文输入数据包括图像特征数据和文本特征数据;
    数据处理模块,用于将所述图文输入数据输入至第一初始模型得到第一参考答案;
    数据筛选模块,用于基于第一参考答案和所述真值答案对所述初始训练数据进行筛选得到第一目标训练数据;
    模型更新模块,利用所述第一目标训练数据的第一参考答案以及对应的所述真值答案更新第二初始模型得到所述视觉问答模型;
    其中,所述第一初始模型和第二初始模型的模型架构一致。
  9. 一种视觉问答任务处理装置,其特征在于,包括:
    特征获取模块,用于获取待提问图像对应的参考图像特征以及对应的参考文本特征;
    任务处理模块,用于将所述参考图像特征和所述参考文本特征输入至视觉问答模型得到目标答案;
    其中,所述视觉问答模型是根据权利要求1至6中任一项所述的视觉问答模型的训练方法得到。
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1至7中任一项所述的方法。
  11. 一种电子设备,其特征在于,包括:
    一个或多个处理器;以及
    存储器,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要求1至7中任一项所述的方法。
PCT/CN2023/138801 2023-07-07 2023-12-14 视觉问答模型的训练、视觉问答任务处理方法及装置 Ceased WO2025010945A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310833232.4 2023-07-07
CN202310833232.4A CN116894996B (zh) 2023-07-07 2023-07-07 视觉问答模型的训练、视觉问答任务处理方法及装置

Publications (1)

Publication Number Publication Date
WO2025010945A1 true WO2025010945A1 (zh) 2025-01-16

Family

ID=88314381

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/138801 Ceased WO2025010945A1 (zh) 2023-07-07 2023-12-14 视觉问答模型的训练、视觉问答任务处理方法及装置

Country Status (2)

Country Link
CN (1) CN116894996B (zh)
WO (1) WO2025010945A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121456487A (zh) * 2025-12-29 2026-02-03 拉扎斯网络科技(上海)有限公司 商家运营模型训练方法、装置、电子设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894996B (zh) * 2023-07-07 2026-03-10 中国电信股份有限公司技术创新中心 视觉问答模型的训练、视觉问答任务处理方法及装置
CN117592567B (zh) * 2023-11-21 2024-05-28 广州方舟信息科技有限公司 药品问答模型训练方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837548A (zh) * 2019-11-05 2020-02-25 泰康保险集团股份有限公司 答案匹配方法、装置、电子设备及存储介质
WO2021217935A1 (zh) * 2020-04-29 2021-11-04 深圳壹账通智能科技有限公司 问题生成模型的训练方法、问题生成方法及其相关设备
WO2023024412A1 (zh) * 2021-08-25 2023-03-02 平安科技(深圳)有限公司 基于深度学习模型的视觉问答方法及装置、介质、设备
CN116894996A (zh) * 2023-07-07 2023-10-17 中国电信股份有限公司技术创新中心 视觉问答模型的训练、视觉问答任务处理方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782839B (zh) * 2020-06-30 2023-08-22 北京百度网讯科技有限公司 图像问答方法、装置、计算机设备和介质
CN112800178A (zh) * 2021-01-28 2021-05-14 平安科技(深圳)有限公司 答案生成方法、装置、电子设备及可读存储介质
CN114840651A (zh) * 2022-04-20 2022-08-02 南方科技大学 视觉问答的训练方法、系统及计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837548A (zh) * 2019-11-05 2020-02-25 泰康保险集团股份有限公司 答案匹配方法、装置、电子设备及存储介质
WO2021217935A1 (zh) * 2020-04-29 2021-11-04 深圳壹账通智能科技有限公司 问题生成模型的训练方法、问题生成方法及其相关设备
WO2023024412A1 (zh) * 2021-08-25 2023-03-02 平安科技(深圳)有限公司 基于深度学习模型的视觉问答方法及装置、介质、设备
CN116894996A (zh) * 2023-07-07 2023-10-17 中国电信股份有限公司技术创新中心 视觉问答模型的训练、视觉问答任务处理方法及装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MA JIE, LIU JUN, LIN QIKA, WU BEI, WANG YAXIAN, YOU YANG: "Multitask Learning for Visual Question Answering", IEEE TRANSACTIONS ON NEURAL NETWORKS AND LEARNING SYSTEMS, IEEE, USA, vol. 34, no. 3, 1 March 2023 (2023-03-01), USA, pages 1380 - 1394, XP093260469, ISSN: 2162-237X, DOI: 10.1109/TNNLS.2021.3105284 *
WANG FENG ,, SHI FANGYU;ZHAO JIA;ZHANG XUESONG;WANG XUEFENG: "Answer mask-fused visual question answering model", JOURNAL OF IMAGE AND GRAPHICS, ZHONGGUO TUXIANG TUXING XUEHUI, CN, vol. 2023, no. 11, 16 November 2023 (2023-11-16), CN , pages 3562 - 3574, XP093260466, ISSN: 1006-8961 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121456487A (zh) * 2025-12-29 2026-02-03 拉扎斯网络科技(上海)有限公司 商家运营模型训练方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN116894996B (zh) 2026-03-10
CN116894996A (zh) 2023-10-17

Similar Documents

Publication Publication Date Title
JP7331171B2 (ja) 画像認識モデルをトレーニングするための方法および装置、画像を認識するための方法および装置、電子機器、記憶媒体、並びにコンピュータプログラム
WO2025010945A1 (zh) 视觉问答模型的训练、视觉问答任务处理方法及装置
CN110189246B (zh) 图像风格化生成方法、装置及电子设备
CN115081616B (zh) 一种数据的去噪方法以及相关设备
CN111562915A (zh) 前端代码生成模型的生成方法和装置
US20250157193A1 (en) Feature extraction model generating method, image feature extracting method and apparatus
CN113393544B (zh) 一种图像处理方法、装置、设备及介质
CN110166650A (zh) 视频集的生成方法及装置、计算机设备与可读介质
CN113688232A (zh) 招标文本分类方法、装置、存储介质及终端
CN118053123A (zh) 报警信息生成方法、装置、电子设备与计算机介质
WO2024114659A1 (zh) 一种摘要生成方法及其相关设备
CN111312223A (zh) 语音分割模型的训练方法、装置和电子设备
CN115690544B (zh) 多任务学习方法及装置、电子设备和介质
CN117454195A (zh) 应用功能的识别方法、装置、终端设备及存储介质
CN114021010B (zh) 一种信息推荐模型的训练方法、装置及设备
CN115273820A (zh) 音频处理方法、装置、存储介质及电子设备
CN118299064B (zh) 基于罕见病的图模型训练方法、应用方法及相关设备
CN114627862A (zh) 基于机器学习的语音识别方法、装置、设备及介质
WO2024193681A1 (zh) 训练数据确定方法、目标检测方法、装置、设备、介质
CN118283380A (zh) 一种视频描述生成方法、装置、计算机设备及存储介质
CN118658032A (zh) 视频生成模型的训练方法、装置、电子设备及存储介质
CN114970955B (zh) 基于多模态预训练模型的短视频热度预测方法及装置
CN117853580A (zh) 位姿确定方法、装置、电子设备和存储介质
CN118312683A (zh) 兴趣点预测模型的确定方法、预测方法、装置、介质
CN114330239A (zh) 文本处理方法及装置、存储介质及电子设备

Legal Events

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

Ref document number: 23944950

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE