<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ghazi saoudi</title>
    <description>The latest articles on DEV Community by Ghazi saoudi (@ghazy001).</description>
    <link>https://dev.to/ghazy001</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4005821%2F177cf044-a2c9-4082-b143-de758decc5d9.png</url>
      <title>DEV Community: Ghazi saoudi</title>
      <link>https://dev.to/ghazy001</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ghazy001"/>
    <language>en</language>
    <item>
      <title>AI Agents Won’t Replace Humans — But a Bad Agent Can Break Production</title>
      <dc:creator>Ghazi saoudi</dc:creator>
      <pubDate>Sun, 28 Jun 2026 00:58:39 +0000</pubDate>
      <link>https://dev.to/ghazy001/ai-agents-wont-replace-humans-but-a-bad-agent-can-break-production-1mk1</link>
      <guid>https://dev.to/ghazy001/ai-agents-wont-replace-humans-but-a-bad-agent-can-break-production-1mk1</guid>
      <description>&lt;p&gt;Every few months, someone says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“AI agents will replace developers.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don’t think that is the right way to look at it.&lt;/p&gt;

&lt;p&gt;AI agents can write code, summarize logs, open pull requests, create tickets, call APIs, run tests, and even deploy software if we allow them to. That is impressive.&lt;/p&gt;

&lt;p&gt;But replacing humans is not just about doing tasks.&lt;/p&gt;

&lt;p&gt;In real production systems, the hard part is not only writing code. The hard part is understanding context, owning consequences, making trade-offs, protecting users, and taking responsibility when something goes wrong.&lt;/p&gt;

&lt;p&gt;An AI agent can execute an action.&lt;/p&gt;

&lt;p&gt;A human owns the outcome.&lt;/p&gt;

&lt;p&gt;That difference matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is an AI agent?
&lt;/h2&gt;

&lt;p&gt;A simple chatbot answers a prompt.&lt;/p&gt;

&lt;p&gt;An AI agent goes further. It can reason over a goal, choose tools, call APIs, read files, modify systems, and continue working through multiple steps.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goal: Fix the failing payment pipeline

Agent actions:
1. Read the error logs
2. Search the codebase
3. Modify a retry function
4. Run tests
5. Open a pull request
6. Suggest deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That looks useful. And it is.&lt;/p&gt;

&lt;p&gt;But now imagine the same agent has access to production credentials, deployment permissions, customer data, or database admin APIs.&lt;/p&gt;

&lt;p&gt;Suddenly this is not just automation.&lt;/p&gt;

&lt;p&gt;It is operational risk.&lt;/p&gt;




&lt;h2&gt;
  
  
  The dangerous question is not “Can the agent do it?”
&lt;/h2&gt;

&lt;p&gt;The dangerous question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What happens when the agent is confidently wrong?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Humans make mistakes too. But production engineering has decades of safety patterns around human mistakes: code review, staging, rollback, access control, audit logs, incident response, separation of duties, and postmortems.&lt;/p&gt;

&lt;p&gt;AI agents need the same discipline.&lt;/p&gt;

&lt;p&gt;Actually, they need more.&lt;/p&gt;

&lt;p&gt;Because agents can fail in strange ways:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Wrong assumption
   ↓
Wrong plan
   ↓
Wrong tool call
   ↓
Wrong production action
   ↓
Real customer impact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The risk is not that an AI agent is “evil.”&lt;/p&gt;

&lt;p&gt;The risk is that it is useful enough to be trusted, but unreliable enough to be dangerous.&lt;/p&gt;




&lt;h2&gt;
  
  
  A critical production error example
&lt;/h2&gt;

&lt;p&gt;Imagine this scenario:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User: Clean old test data from the database.

Agent:
- Finds a database token
- Misunderstands "test data"
- Connects to production
- Runs a destructive delete query
- Removes real customer records
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent did not “intend” to destroy production.&lt;/p&gt;

&lt;p&gt;But production does not care about intention.&lt;/p&gt;

&lt;p&gt;Production cares about impact.&lt;/p&gt;

&lt;p&gt;A wrong command from a human and a wrong command from an AI agent can both delete the same database.&lt;/p&gt;

&lt;p&gt;That is why we should never give an AI agent unlimited access just because it gives smart answers in a chat window.&lt;/p&gt;




&lt;h2&gt;
  
  
  Simple architecture schema for safer agents
&lt;/h2&gt;

&lt;p&gt;A production-grade AI agent should not connect directly to critical systems.&lt;/p&gt;

&lt;p&gt;It should go through permission layers, approval gates, monitoring, and rollback mechanisms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    User[Human User] --&amp;gt; Agent[AI Agent]
    Agent --&amp;gt; Planner[Planner / Reasoning Layer]
    Planner --&amp;gt; Policy[Policy &amp;amp; Permission Engine]
    Policy --&amp;gt;|Read-only actions| Tools[Safe Tools]
    Policy --&amp;gt;|Risky actions| Approval[Human Approval Gate]
    Approval --&amp;gt; Tools
    Tools --&amp;gt; Logs[Action Ledger / Audit Logs]
    Tools --&amp;gt; Sandbox[Staging or Sandbox First]
    Sandbox --&amp;gt; Deploy[Production Deployment]
    Deploy --&amp;gt; Monitor[Monitoring &amp;amp; Alerts]
    Monitor --&amp;gt; Rollback[Rollback / Kill Switch]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The agent can suggest. The system controls. The human approves critical actions.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Agent safety policy schema
&lt;/h2&gt;

&lt;p&gt;Before deploying an agent, define its permissions like you would define infrastructure, security, or API contracts.&lt;/p&gt;

&lt;p&gt;Here is a simple YAML-style schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;agent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production-assistant&lt;/span&gt;
  &lt;span class="na"&gt;purpose&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Help&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;engineers&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;investigate&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;issues&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;and&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;propose&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;fixes"&lt;/span&gt;
  &lt;span class="na"&gt;autonomy_level&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;supervised&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;read&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;logs&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;metrics&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;source_code&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;documentation&lt;/span&gt;

  &lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;draft_pull_request&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;create_ticket&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;comment_on_incident&lt;/span&gt;

  &lt;span class="na"&gt;forbidden&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;delete_database&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;modify_customer_data&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;deploy_to_production_without_approval&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;rotate_secrets&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;change_billing_rules&lt;/span&gt;

&lt;span class="na"&gt;approval_required_for&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;production_deploy&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;database_migration&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;infrastructure_change&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customer_notification&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;security_policy_change&lt;/span&gt;

&lt;span class="na"&gt;observability&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;action_ledger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;tool_call_logging&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;prompt_and_response_audit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;alert_on_policy_violation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;recovery&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rollback_required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;snapshot_before_change&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;kill_switch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not over-engineering.&lt;/p&gt;

&lt;p&gt;This is basic survival.&lt;/p&gt;

&lt;p&gt;If an agent can touch production, it must be treated like a production actor.&lt;/p&gt;




&lt;h2&gt;
  
  
  Risk formula for AI agents
&lt;/h2&gt;

&lt;p&gt;A simple way to think about agent risk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Risk = Autonomy × Permission × Irreversibility × Blast Radius
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An agent that summarizes logs has low risk.&lt;/p&gt;

&lt;p&gt;An agent that can deploy code has medium risk.&lt;/p&gt;

&lt;p&gt;An agent that can modify production databases has high risk.&lt;/p&gt;

&lt;p&gt;An agent that can modify production databases without approval is a disaster waiting to happen.&lt;/p&gt;




&lt;h2&gt;
  
  
  What famous tech people are really warning us about
&lt;/h2&gt;

&lt;p&gt;Linus Torvalds has been skeptical of AI hype. His point is important for engineers: do not confuse demos with real-world reliability.&lt;/p&gt;

&lt;p&gt;A demo can look magical.&lt;/p&gt;

&lt;p&gt;Production is where the truth appears.&lt;/p&gt;

&lt;p&gt;Jensen Huang has argued that AI will not simply remove engineers, but increase what productive teams can build. I agree with that more than the “AI will replace everyone” narrative.&lt;/p&gt;

&lt;p&gt;The future is not fewer humans.&lt;/p&gt;

&lt;p&gt;The future is humans with more powerful tools — and more responsibility.&lt;/p&gt;

&lt;p&gt;Yann LeCun’s work also reminds us that current AI systems are still not equivalent to human intelligence. They do not learn from the world like humans and animals do. They do not truly understand business context, social consequences, or moral responsibility.&lt;/p&gt;

&lt;p&gt;Sam Altman has said that AI agents may “join the workforce.” That wording is interesting.&lt;/p&gt;

&lt;p&gt;Join.&lt;/p&gt;

&lt;p&gt;Not replace.&lt;/p&gt;

&lt;p&gt;That is the mindset engineering teams should adopt.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why humans still matter
&lt;/h2&gt;

&lt;p&gt;Humans are not valuable only because they type code.&lt;/p&gt;

&lt;p&gt;Humans are valuable because they can ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Should we do this?
Who is affected?
What happens if this fails?
Is this legal?
Is this fair?
Can we recover?
Are we solving the right problem?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI agents are good at generating possible actions.&lt;/p&gt;

&lt;p&gt;Humans are responsible for choosing acceptable actions.&lt;/p&gt;

&lt;p&gt;That is the boundary.&lt;/p&gt;




&lt;h2&gt;
  
  
  Production checklist before using AI agents
&lt;/h2&gt;

&lt;p&gt;Before allowing an AI agent into your engineering workflow, ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ] Does the agent have least-privilege access?
[ ] Can it access production secrets?
[ ] Can it perform destructive actions?
[ ] Are dangerous actions blocked by policy?
[ ] Is human approval required for production changes?
[ ] Are all tool calls logged?
[ ] Can we replay what happened during an incident?
[ ] Is there a rollback plan?
[ ] Is there a kill switch?
[ ] Was the agent tested against prompt injection?
[ ] Does it run in staging before production?
[ ] Are engineers trained to verify its output?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the answer to these questions is “no,” the agent is not ready for production.&lt;/p&gt;

&lt;p&gt;It is ready for a sandbox.&lt;/p&gt;




&lt;h2&gt;
  
  
  The real future: human + agent
&lt;/h2&gt;

&lt;p&gt;AI agents will change software engineering.&lt;/p&gt;

&lt;p&gt;They will make some tasks faster. They will reduce repetitive work. They will help small teams move like bigger teams. They will help developers understand unfamiliar codebases faster.&lt;/p&gt;

&lt;p&gt;But they should not replace human judgment.&lt;/p&gt;

&lt;p&gt;The best engineering teams will not be the teams that blindly automate everything.&lt;/p&gt;

&lt;p&gt;The best teams will be the ones that know what to automate, what to supervise, and what must always remain a human decision.&lt;/p&gt;

&lt;p&gt;AI agents are powerful.&lt;/p&gt;

&lt;p&gt;But power without control is not intelligence.&lt;/p&gt;

&lt;p&gt;It is risk.&lt;/p&gt;

&lt;p&gt;So no, AI agents will not replace humans.&lt;/p&gt;

&lt;p&gt;But teams that understand how to safely use agents may replace teams that do not.&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>devops</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>I Built a macOS GUI App to Find Instagram Unfollowers</title>
      <dc:creator>Ghazi saoudi</dc:creator>
      <pubDate>Sat, 27 Jun 2026 22:33:04 +0000</pubDate>
      <link>https://dev.to/ghazy001/i-built-a-macos-gui-app-to-find-instagram-unfollowers-5a1g</link>
      <guid>https://dev.to/ghazy001/i-built-a-macos-gui-app-to-find-instagram-unfollowers-5a1g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Managing an Instagram following list can become messy over time.&lt;/p&gt;

&lt;p&gt;You follow people, some follow you back, some do not, and eventually it becomes difficult to know who is actually mutual. I wanted to build a simple desktop tool that makes this easier without sending user data to an external server.&lt;/p&gt;

&lt;p&gt;That is why I built &lt;strong&gt;InstaClean&lt;/strong&gt;, a macOS GUI application that helps users find Instagram accounts that do not follow them back and unfollow selected accounts from a local interface.&lt;/p&gt;

&lt;p&gt;The goal was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Build a clean, local, dark-mode desktop app for checking Instagram unfollowers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What the App Does
&lt;/h2&gt;

&lt;p&gt;InstaClean scans your Instagram following list and compares it with your followers list.&lt;/p&gt;

&lt;p&gt;Then it shows the accounts that you follow but that do not follow you back.&lt;/p&gt;

&lt;p&gt;The app includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A dark modern interface inspired by Instagram&lt;/li&gt;
&lt;li&gt;A scan button to detect non-followers&lt;/li&gt;
&lt;li&gt;Search functionality&lt;/li&gt;
&lt;li&gt;Pagination for easier navigation&lt;/li&gt;
&lt;li&gt;Multi-select checkboxes&lt;/li&gt;
&lt;li&gt;An “Unfollow Selected” button&lt;/li&gt;
&lt;li&gt;Local execution, meaning data stays on your machine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea was to make the workflow fast and simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the app&lt;/li&gt;
&lt;li&gt;Scan your account&lt;/li&gt;
&lt;li&gt;Review the results&lt;/li&gt;
&lt;li&gt;Select accounts&lt;/li&gt;
&lt;li&gt;Unfollow only the ones you choose&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why I Built It as a Desktop App
&lt;/h2&gt;

&lt;p&gt;I could have built this as a web app, but I wanted the project to stay local.&lt;/p&gt;

&lt;p&gt;A desktop app made more sense because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;users do not need to upload their Instagram data anywhere&lt;/li&gt;
&lt;li&gt;the app can run directly on macOS&lt;/li&gt;
&lt;li&gt;the interface feels more private&lt;/li&gt;
&lt;li&gt;setup is simple for Python users&lt;/li&gt;
&lt;li&gt;the project can be packaged later as a &lt;code&gt;.app&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Privacy was one of the main design goals. The app does not need a separate backend server, database, or hosted API.&lt;/p&gt;

&lt;p&gt;Everything runs locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;The project uses Python and a desktop GUI approach.&lt;/p&gt;

&lt;p&gt;The basic stack is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python 3.9+&lt;/strong&gt; for the application logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS&lt;/strong&gt; as the target platform&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instagram web session cookies&lt;/strong&gt; for authenticated requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;py2app&lt;/strong&gt; as an optional tool for generating a macOS &lt;code&gt;.app&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project can be run directly with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For users who want a real macOS application bundle, it can also be packaged with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;py2app
python setup.py py2app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The generated app is placed inside the &lt;code&gt;dist/&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Scan for accounts that do not follow back
&lt;/h3&gt;

&lt;p&gt;The main feature is the scan system.&lt;/p&gt;

&lt;p&gt;When the user clicks &lt;strong&gt;Scan Now&lt;/strong&gt;, the app checks the account’s following and followers data, then displays users who are not following back.&lt;/p&gt;

&lt;p&gt;This makes the app useful for people who want to clean their following list manually instead of scrolling through Instagram one account at a time.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Search bar
&lt;/h3&gt;

&lt;p&gt;When the result list is long, searching becomes important.&lt;/p&gt;

&lt;p&gt;The app includes a search bar so users can quickly filter accounts by username.&lt;/p&gt;

&lt;p&gt;This makes the interface much easier to use when there are many results.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Pagination
&lt;/h3&gt;

&lt;p&gt;Instead of displaying every result at once, the app uses pagination.&lt;/p&gt;

&lt;p&gt;Each page shows a limited number of accounts, which keeps the interface cleaner and easier to navigate.&lt;/p&gt;

&lt;p&gt;This also improves usability because the user is not overwhelmed by a huge list.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Multi-select unfollow
&lt;/h3&gt;

&lt;p&gt;The app allows users to select multiple accounts and then click &lt;strong&gt;Unfollow Selected&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is faster than unfollowing one by one, but it still gives the user control because they choose which accounts to remove.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Local-first design
&lt;/h3&gt;

&lt;p&gt;One of the most important decisions was keeping the app local.&lt;/p&gt;

&lt;p&gt;The app is designed so user data stays on the machine. There is no external database, no cloud processing, and no separate server.&lt;/p&gt;

&lt;p&gt;For a tool that interacts with a personal social media account, this matters a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;The project can be installed by cloning the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/ghazy001/InstaClean.git
&lt;span class="nb"&gt;cd &lt;/span&gt;InstaClean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install the Python dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, configure the required Instagram session values inside the app.&lt;/p&gt;

&lt;p&gt;The app needs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;CSRFTOKEN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your_csrftoken&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;SESSIONID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your_sessionid&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;DS_USER_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your_user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These values come from your own browser session after logging in to Instagram.&lt;/p&gt;

&lt;p&gt;Important: these values should be treated like sensitive credentials. Never share them, never commit them to GitHub, and never publish them in screenshots.&lt;/p&gt;

&lt;p&gt;A better future improvement would be to move them into a &lt;code&gt;.env&lt;/code&gt; file instead of writing them directly in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the App
&lt;/h2&gt;

&lt;p&gt;After setup, the app can be started with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the GUI opens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Scan Now&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Wait for the app to load accounts that do not follow back&lt;/li&gt;
&lt;li&gt;Use the search bar if needed&lt;/li&gt;
&lt;li&gt;Select the accounts you want to unfollow&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Unfollow Selected&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The app gives the user a more organized way to review accounts before taking action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Notes
&lt;/h2&gt;

&lt;p&gt;This project uses Instagram’s unofficial web API through the user’s own browser cookies.&lt;/p&gt;

&lt;p&gt;Because of that, there are some important limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The app is not officially approved by Meta&lt;/li&gt;
&lt;li&gt;Instagram may change its internal endpoints&lt;/li&gt;
&lt;li&gt;Too many unfollow actions can trigger temporary restrictions&lt;/li&gt;
&lt;li&gt;Users should avoid aggressive automation&lt;/li&gt;
&lt;li&gt;Cookies must be kept private&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This project should be used responsibly and only with your own Instagram account.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Building this app taught me a lot about combining GUI development, local automation, and user-focused design.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. A simple GUI can make automation safer
&lt;/h3&gt;

&lt;p&gt;Instead of blindly unfollowing accounts from a script, a GUI gives the user control.&lt;/p&gt;

&lt;p&gt;The user can review results, search names, select accounts manually, and decide what to do.&lt;/p&gt;

&lt;p&gt;That makes the tool more transparent.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Pagination improves usability
&lt;/h3&gt;

&lt;p&gt;At first, it may seem easy to show every result in one list.&lt;/p&gt;

&lt;p&gt;But if the list is large, the interface becomes messy.&lt;/p&gt;

&lt;p&gt;Pagination makes the app cleaner and easier to use.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Local apps are still useful
&lt;/h3&gt;

&lt;p&gt;Not every project needs to be a web app.&lt;/p&gt;

&lt;p&gt;For personal tools, desktop apps can be a great choice because they are private, direct, and easy to run.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Credentials should be handled carefully
&lt;/h3&gt;

&lt;p&gt;Using browser cookies works, but it also creates security responsibility.&lt;/p&gt;

&lt;p&gt;A future version should avoid hardcoding cookies and instead use environment variables or a local configuration file ignored by Git.&lt;/p&gt;

&lt;h2&gt;
  
  
  Possible Improvements
&lt;/h2&gt;

&lt;p&gt;There are several improvements I would like to add in the future:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store cookies in a &lt;code&gt;.env&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Add better error handling for expired sessions&lt;/li&gt;
&lt;li&gt;Add confirmation dialogs before unfollowing&lt;/li&gt;
&lt;li&gt;Add rate limiting to reduce the risk of temporary blocks&lt;/li&gt;
&lt;li&gt;Add a progress bar during scanning&lt;/li&gt;
&lt;li&gt;Add export to CSV&lt;/li&gt;
&lt;li&gt;Improve packaging as a macOS &lt;code&gt;.app&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add a safer login/session setup flow&lt;/li&gt;
&lt;li&gt;Add light mode and theme customization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These features would make the app more polished and safer to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;InstaClean started as a simple idea: make it easier to see who does not follow you back on Instagram.&lt;/p&gt;

&lt;p&gt;But it became a useful exercise in building a local desktop app with Python, designing a clean GUI, handling user interaction, and thinking carefully about privacy.&lt;/p&gt;

&lt;p&gt;The most important lesson from this project is that automation tools should not just be powerful. They should also be understandable, controlled, and respectful of user privacy.&lt;/p&gt;

&lt;p&gt;For me, this was a fun project that combined Python, GUI development, and real-world social media workflow automation into one practical macOS app.&lt;/p&gt;

</description>
      <category>python</category>
      <category>automation</category>
      <category>tkinter</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building an Artist Attribution Model with PyTorch and ResNet-50</title>
      <dc:creator>Ghazi saoudi</dc:creator>
      <pubDate>Sat, 27 Jun 2026 22:21:53 +0000</pubDate>
      <link>https://dev.to/ghazy001/building-an-artist-attribution-model-with-pytorch-and-resnet-50-2pde</link>
      <guid>https://dev.to/ghazy001/building-an-artist-attribution-model-with-pytorch-and-resnet-50-2pde</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Can an AI model look at a painting and predict who created it?&lt;/p&gt;

&lt;p&gt;That was the main idea behind this project: an &lt;strong&gt;artist attribution system&lt;/strong&gt; built with &lt;strong&gt;PyTorch&lt;/strong&gt; and &lt;strong&gt;ResNet-50&lt;/strong&gt;. The goal was to train a deep learning model on a dataset of paintings and allow it to predict the most likely artist behind a new image.&lt;/p&gt;

&lt;p&gt;Instead of building a convolutional neural network from scratch, I used &lt;strong&gt;transfer learning&lt;/strong&gt; with a pretrained ResNet-50 model. This made the project more practical, faster to train, and easier to adapt to a custom art dataset.&lt;/p&gt;

&lt;p&gt;In this article, I’ll walk through the idea, project structure, training process, inference flow, and the lessons learned while building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Project Does
&lt;/h2&gt;

&lt;p&gt;The project classifies paintings by artist.&lt;/p&gt;

&lt;p&gt;Given an input image, the model predicts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the most likely artist&lt;/li&gt;
&lt;li&gt;the confidence score&lt;/li&gt;
&lt;li&gt;the top 3 possible artist guesses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;🎨 Predicted artist: Vincent van Gogh
🔒 Confidence: 0.87
🔎 Top 3 guesses:
 - Vincent van Gogh &lt;span class="o"&gt;(&lt;/span&gt;0.874&lt;span class="o"&gt;)&lt;/span&gt;
 - Claude Monet &lt;span class="o"&gt;(&lt;/span&gt;0.054&lt;span class="o"&gt;)&lt;/span&gt;
 - Paul Cézanne &lt;span class="o"&gt;(&lt;/span&gt;0.032&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the project useful as a practical introduction to computer vision, fine-tuning, and image classification.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why ResNet-50?
&lt;/h2&gt;

&lt;p&gt;ResNet-50 is a powerful convolutional neural network architecture that has already learned useful visual patterns from ImageNet.&lt;/p&gt;

&lt;p&gt;For this project, using a pretrained model made sense because painting classification requires the model to understand visual features such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;brush strokes&lt;/li&gt;
&lt;li&gt;color palettes&lt;/li&gt;
&lt;li&gt;composition&lt;/li&gt;
&lt;li&gt;texture&lt;/li&gt;
&lt;li&gt;artistic style&lt;/li&gt;
&lt;li&gt;recurring visual patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Training a deep model from zero would require a much larger dataset and more compute. Transfer learning allowed me to reuse the knowledge from ResNet-50 and adapt it to the artist classification task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Features
&lt;/h2&gt;

&lt;p&gt;The project includes several useful features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transfer learning with ResNet-50&lt;/li&gt;
&lt;li&gt;Safe image loading to skip corrupted images&lt;/li&gt;
&lt;li&gt;Support for CUDA, Apple Silicon M-series, and CPU&lt;/li&gt;
&lt;li&gt;Training and inference scripts&lt;/li&gt;
&lt;li&gt;Top-3 prediction output&lt;/li&gt;
&lt;li&gt;Colab notebook support for cloud training&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes the project flexible enough to run locally or in a cloud notebook environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;The repository is organized like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;artist-classification/
├── dataset/              &lt;span class="c"&gt;# dataset folder&lt;/span&gt;
├── train.py              &lt;span class="c"&gt;# training script&lt;/span&gt;
├── predict.py            &lt;span class="c"&gt;# inference script&lt;/span&gt;
├── artist_model.pth      &lt;span class="c"&gt;# trained model weights&lt;/span&gt;
├── README.md
└── test.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dataset is not included directly in the repository because of its size. After downloading it, the expected folder structure is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dataset/
├── train/
│   ├── artist_1/
│   ├── artist_2/
│   └── ...
└── val/
    ├── artist_1/
    ├── artist_2/
    └── ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure is important because image classification tools in PyTorch often rely on folder names as class labels.&lt;/p&gt;

&lt;p&gt;For example, if the folder is named &lt;code&gt;Vincent_van_Gogh&lt;/code&gt;, the model can treat that folder as one class.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Requirements
&lt;/h2&gt;

&lt;p&gt;The project uses a simple Python setup.&lt;/p&gt;

&lt;p&gt;Install the required dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;torch torchvision pillow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main libraries are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;torch&lt;/code&gt; for deep learning&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;torchvision&lt;/code&gt; for pretrained models and image transforms&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Pillow&lt;/code&gt; for image loading and processing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Training the Model
&lt;/h2&gt;

&lt;p&gt;To train the model locally, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 train.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The training script handles several steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detects the available device&lt;/li&gt;
&lt;li&gt;Loads the painting dataset&lt;/li&gt;
&lt;li&gt;Applies image transformations&lt;/li&gt;
&lt;li&gt;Fine-tunes ResNet-50&lt;/li&gt;
&lt;li&gt;Saves the trained model as &lt;code&gt;artist_model.pth&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One detail I liked about this project is that it supports multiple environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CUDA for NVIDIA GPUs&lt;/li&gt;
&lt;li&gt;MPS for Apple Silicon Macs&lt;/li&gt;
&lt;li&gt;CPU as a fallback&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes the project easier to run across different machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Inference
&lt;/h2&gt;

&lt;p&gt;After training, you can classify a test image with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 predict.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The prediction script loads the trained model and runs inference on an image.&lt;/p&gt;

&lt;p&gt;Instead of only returning one answer, it gives the top 3 predictions. This is useful because art attribution can be uncertain. Two artists may have similar visual styles, especially if they belong to the same movement or period.&lt;/p&gt;

&lt;p&gt;A Top-3 output gives more context than a single prediction.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;This project helped me understand several important deep learning concepts.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Transfer learning saves time
&lt;/h3&gt;

&lt;p&gt;Starting from a pretrained ResNet-50 model made the project much more realistic. The model already understands general image features, so the training process focuses on adapting those features to paintings.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Dataset structure matters
&lt;/h3&gt;

&lt;p&gt;For image classification, clean folder organization is very important. If the dataset is not structured correctly, training can fail or produce incorrect labels.&lt;/p&gt;

&lt;p&gt;A simple structure like this works well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;train/class_name/
val/class_name/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Inference should be user-friendly
&lt;/h3&gt;

&lt;p&gt;A model prediction is more useful when it includes confidence scores and alternative guesses.&lt;/p&gt;

&lt;p&gt;Instead of only printing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Vincent van Gogh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the project prints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Vincent van Gogh &lt;span class="o"&gt;(&lt;/span&gt;0.874&lt;span class="o"&gt;)&lt;/span&gt;
Claude Monet &lt;span class="o"&gt;(&lt;/span&gt;0.054&lt;span class="o"&gt;)&lt;/span&gt;
Paul Cézanne &lt;span class="o"&gt;(&lt;/span&gt;0.032&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the output easier to understand and debug.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Hardware support improves accessibility
&lt;/h3&gt;

&lt;p&gt;Not everyone has the same machine. Supporting CUDA, Apple Silicon, and CPU makes the project easier for more developers to try.&lt;/p&gt;

&lt;h2&gt;
  
  
  Possible Improvements
&lt;/h2&gt;

&lt;p&gt;There are several ways this project could be improved in the future:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a Streamlit or Gradio web interface&lt;/li&gt;
&lt;li&gt;Include evaluation metrics such as accuracy and confusion matrix&lt;/li&gt;
&lt;li&gt;Add data augmentation for better generalization&lt;/li&gt;
&lt;li&gt;Support batch prediction for multiple images&lt;/li&gt;
&lt;li&gt;Add model checkpointing during training&lt;/li&gt;
&lt;li&gt;Deploy the model as an API&lt;/li&gt;
&lt;li&gt;Compare ResNet-50 with EfficientNet or Vision Transformers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple web interface would make the project especially impressive because users could upload a painting and instantly see the predicted artist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This project was a great way to combine art and machine learning.&lt;/p&gt;

&lt;p&gt;By using PyTorch, transfer learning, and ResNet-50, I built a model that can classify paintings by artist and return the top predictions with confidence scores.&lt;/p&gt;

&lt;p&gt;The most important lesson is that deep learning projects do not always need to start from scratch. With transfer learning, we can build useful and interesting computer vision applications faster while still learning the core ideas behind model training, inference, and evaluation.&lt;/p&gt;

&lt;p&gt;If you are learning PyTorch or computer vision, building an artist classification model is a fun and practical project to try.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>python</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
