Code-MIE: A Code-style Model for Multimodal Information Extraction with Scene Graph and Entity Attribute Knowledge Enhancement
Authors: Jiang Liu, Ge Qiu, Hao Fei, Dongdong Xie, Jinbo Li, Fei Li, Chong Teng, Donghong Ji
Organizations: Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University · University of Oxford · Wuhan Second Ship Design and Research Institute · China United Network Communications Co., Ltd. Research Institute
With the rapid development of large language models (LLMs), more and more researchers have paid attention to information extraction based on LLMs. However, there are still some spaces to improve in the existing related methods. First, existing multimodal information extraction (MIE) methods usually employ natural language templates as the input and output of LLMs, which mismatch with the characteristics of information tasks that mostly include structured information such as entities and relations. Second, although a few methods have adopted structured and more IE-friendly code-style templates, they just explored their methods on text-only IE rather than multimodal IE. Moreover, their methods are more complex in design, requiring separate templates to be designed for each task. In this paper, we propose a Code-style Multimodal Information Extraction framework (Code-MIE) which formalizes MIE as unified code understanding and generation. Code-MIE has the following novel designs: (1) Entity attributes such as gender, affiliation are extracted from the text to guide the model to understand the context and role of entities. (2) Images are converted into scene graphs and visual features to incorporate rich visual information into the model. (3) The input template is constructed as a Python function, where entity attributes, scene graphs and raw text compose of the function parameters. In contrast, the output template is formalized as Python dictionaries containing all extraction results such as entities, relations, etc. To evaluate Code-MIE, we conducted extensive experiments on the M3D, Twitter-15, Twitter-17, and MNRE datasets. The results show that our method achieves state-of-the-art performance compared to six competing baseline models, with 61.03% and 60.49% on the English and Chinese datasets of M3D, and 76.04%, 88.07%, and 73.94% on the other three datasets.
Figures & tables
Fig. 1: The difference between our code-style template and existing code-style templates.
Fig. 2: The framework of Code-MIE.
PER
name, occupation, gender, nationality, marital status, place of birth, place of death
TABLE IV: Statistics for M 3 D. (Doc.: Document, Sent.: Sentence, Ent.: Entity, Rel.: Relation, Cha.: Entity Chain, Gro.: Visual Grounding)
Twitter-15
Twitter-17
MNRE
Sent.
Ent.
Sent.
Ent.
Sent.
Ent.
Rel.
Train
4,000
6,123
3,373
6,003
7,330
2,4494
12,247
Dev
1,000
1,524
723
1,313
931
3,248
1,624
Test
3,257
5,085
723
1,339
914
3,228
1,614
TABLE V: Statistics for Twitter-15, Twitter-17 and MNRE.
Ent.
Cha.
Rel.
Gro.
Avg.
EN
Qwen3-VL
72.07
67.54
33.62
40.13
53.34
REAMO
74.84
67.06
34.17
44.85
55.23
CodeIE
77.27
68.95
35.99
46.26
57.12
KnowCoder
78.31
69.43
37.72
46.10
57.89
CodeKGC
77.04
68.41
36.51
45.09
56.76
Code4UIE
77.43
68.35
35.70
45.14
56.66
TABLE VI: Comparison of our model with baseline models on M 3 D. We only report the F1 for each task. Bold indicates the best result in each column. Avg. represents the average performance of the four tasks.
Twitter-15
Twitter-17
MNRE
Qwen3-VL-8B
71.91
83.27
66.27
REAMO
72.68
83.73
67.14
CodeIE
73.12
84.93
69.80
KnowCoder
74.02
86.47
70.66
CodeKGC
73.62
85.25
69.68
Code4UIE
73.47
85.36
69.90
TABLE VII: Comparison of our model with baseline models on Twitter-15, Twitter-17 and MNRE. We only report the F1 for each task.
Ent.
Cha.
Rel.
Gro.
Avg.
EN
Full Model
79.56
72.85
41.49
50.22
61.03
w/o EA
78.71
72.55
39.20
49.20
59.92
w/o SG
78.82
72.64
39.69
48.58
59.93
w/o VF
78.56
71.71
40.25
48.91
59.86
NLT
76.28
72.08
39.16
47.38
58.73
ZH
Full Model
82.26
80.81
46.73
32.14
60.49
TABLE VIII: Ablation experiment on the M 3 D dataset. (EA: Entity Attribute, SG: Scene Graph, VF: Visual Feature, NLT: Natural Language Template)
Twitter-15
Twitter-17
MNRE
Full Model
76.04
88.07
73.94
w/o EA
75.53
87.58
73.16
w/o SG
75.19
87.11
72.28
w/o VF
75.00
86.94
71.74
NLT
74.96
86.92
73.20
TABLE IX: Ablation on Twitter-15, Twitter-17 and MNRE.
Fig. 3: Comparison of the natural language template and code-style template in hallucination errors.
Fig. 4: Case study of entity attribute knowledge on the M 3 D dataset.
Fig. 5: Case study of scene graph knowledge on the M 3 D dataset.
Fig. 6: Error analysis of four tasks on the M 3 D dataset.
Fig. 7: Error analysis of four tasks on the Twiter15, Twitter17 and MNRE dataset.