Twitterプロフィールからスパムみたいなアカウントかを機械学習で判定してみた。

2021.06.28

Logging

Twitterプロフィールからスパムみたいなアカウントかを機械学習で判定してみました。

機械学習にしてもらう①。

何故、このような事を考えたかはスパムみたいなアカウントってぱっと見で人は区別できるよねって思ったのでLobeというソフトを使って画像解析(機械学習)してモデルをエクスポートし、そのモデルをテンソルフローで使用して動作確認してみました。

機械学習にしてもらう②

結果は、まぁまぁの精度だったのでモデルをお裾分けしますね。因みにTwitterのプロフィール画像のスクリーンショットを行った時のソースコードも提供します。

尚、機械学習に使用したプロフィール画像は400枚ほど(少ない?)です、ok-image(一般人)とng-image(スパムみたいなアカウント)というラベルを付けて学習させてます。

model::https://zip358.com/ai-model/tw-profile/saved_model.pb (?モデルの中身はtensorboardでご確認を!)

zip358com
zip358
# Generated by Selenium IDE
import time
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import Select

class twss():
	def setup_method(self):
		self.driver = webdriver.Chrome(ChromeDriverManager().install())
		self.vars = {}

	def teardown_method(self):
		self.driver.quit()

	def screenshots(self):
		self.driver.get("https://twitter.com/")
		self.driver.set_window_size(945, 900)
		with open('twname.dat','r',encoding="utf-8") as f:
			for line in f:
				FILENAME = "X:\\var\\www\\html\\labo_ai\\twss\\image\\screen_" + line.replace('\n', '') +".png"
				self.driver.get("https://twitter.com/" + line.replace('\n', ''))
				time.sleep(2)
				self.driver.save_screenshot(FILENAME)
		f.close()
		self.driver.quit()
twss = twss()
twss.setup_method()
twss.screenshots()

タグ

358, 400, ai-model, com, https, lobe, model, ng-image, ok-image, SA, tw-profile, Twitter, zip, アカウント, エクスポート, お裾分け, コード, ショット, スクリーン, スパム, ソース, ソフト, テンソル, フロー, プロフィール, モデル, ラベル, 一般人, , , 何故, 使用, 判定, 動作, 区別, 学習, 提供, , 機械, 画像, 確認, 精度, 結果, 解析,